The following table summarizes all 21 commands for Git. See Table A.1, “Commands” in Appendix A, Comparison Table for a comparison of Git’s commands with other tools.
Operation | Git Command |
---|---|
Create | git init |
Checkout | [a] |
Commit | git commit -a[b] |
Update | git checkout[c] |
Add | git add[d] |
Edit | git add[e] |
Delete | git rm |
Rename | git mv |
Move | git mv |
Status | git status |
Diff | git diff |
Revert | git checkout[f] |
Log | git log |
Tag | git tag |
Branch | git branch |
Merge | git merge |
Resolve | [g] |
Lock | [h] |
Clone | git clone |
Push | git push |
Pull | git fetch[i] |
[a] N/A: Git keeps the repository instance inside the working copy. [b] Without the -a flag, git will commit only those changes which have been explicitly added to its staging area. [c] Git automatically updates the working copy as part of a git pull. [d] git add is also used to add any sort of change to the staging area. [e] Or use git commit -a [f] git revert is a completely different command, used to alter changesets that have already been committed. [g] N/A [h] Unsupported [i] git fetch implements the behavior I describe as pull; git pull is equivalent to pull followed by update. |