Git distributed version control
Git installation Configuration
Linux&unix Platform
debian/ubuntu$ Apt-getInstallgitfedora$Yum InstallGit (Up to Fedora +) $ DNFInstallGit (Fedora Aand later) gentoo$ emerge--ask--verbose dev-vcs/Gitarch linux$ Pacman-S gitopensuse$ ZypperInstallgitfreebsd$ CD/usr/ports/devel/git$ Make InstallSolaris Oneexpress$ PkgInstalldeveloper/versioning/gitopenbsd$ pkg_add git
Windows
Official website: Https://git-scm.com/download/win
Mac
: https://sourceforge.net/projects/git-osx-installer/
Git Configuration
Set user name and email
" Lingdong " "[email protected]"
View configuration information
git config--list
Working with GIT Distributed version control system workflow
Cloning data to the local machine working directory
Locally established branch, modify code
Commit code on a branch of your own establishment
Merge the branch with the main branch after the modification is complete
Push local code to remote server
The version warehouse administrator audits, using the Allow push
Three big open source sites
SourceForge
CodePlex
Github
Common git commands
Initialize && clone
Git init git clone
Build a project
Add (adding files to the cache) & Commit
git add *git add README
Add buffer content to the warehouse,-M provides commit comments on the command line
" Init project version "
Status Check file state
git status
Ignore file ignores specified files
Cat. Gitignore Ignoring files
Vim. Gitignore Add ignored Files
Diff
Git diff
git diff--staged
git diff--cached viewing cached changes
Git reset HEAD is used to cancel cached content
git reset HEAD--hello.jsp
Git rm removes files from the cache and your hard drive (working directory)
git rm hello.jsp
Git mv Rename the files on the disk with the same effect as the git rm--cached command
Git fetch is getting the latest version from remote to local
-P Master origin/Mastergit merge Origin/master
Git pull gets the latest version from remote and merges to local
Git pull Origin Master
Git distributed version Control tutorial