超级Git笔记(通俗理解git命令)
笔记总结了git常用的命令,以及对每条命令的解释。部分命令增添了一些例子帮助理解。
完整笔记可在微信公众号阅读:超级Git笔记
目录:
-
Git vs Github
-
How does git work? (a general introduction)
-
git init (create a new repository)
-
git clone (copy existing repositories from somewhere else to your local computer)
-
git status (check the status of a repository)
-
git log (displays information about the existing commits)
-
git log --oneline
-
git log --stat
-
git log -p
-
git log [--oneline/--stat/-p] SHA (display a specific commit's details)
-
git show (displays information about the given commit)
-
git add (add files from the working directory to the staging index)
-
git rm --cached (remove a file from the Staging index)
-
git commit (take files from the staging index and save them in the repository)
-
git commit -m
-
git commit --amend (alter the most-recent commit)
-
git revert (reverse the given commit)
-
Relative Commit References
-
git reset (erase commits)
-
git diff (displays the difference between two versions of a file)
-
git ignore
-
git tag (add a tag to a specific commit)
-
git tag (verify tag)
-
git tag -d (delete a tag)
-
git branch (develop different features of your project in parallel)
-
git checkout (switch between different branches and tags)
-
git checkout -b (create and switch branch in one command)
-
git branch -d
-
git log --oneline --decorate --graph --all (see all branches at once)
-
git merge (combines changes on different branches)
-
Handle Merge Conflicting