- pag
-
Commands
-
add
- -i interactive mode
- -p patch mode
-
branch
-
-r
- shows you the remote branches
-
archive
- git archive --format=tar \
--prefix=mysite-1.0/ tagname \
| gzip > mysite-1.0.tar.gz
- status
-
diff
-
--cached
- View the differences
in the staging area and the repository
-
--stat
- prints some statistics about
the changes that have been made
-
merge
-
--squash
- take all the commits from the other
branch and squash them into one commit
- cherry-pick
- mergetool
-
revert
- revert a commit
-
-n
- not to commit
- is useful when you need
to revert multiple commits
-
reset
- reset the repository to the state we want
- It defaults to HEAD if you don’t provide one
-
--soft
- when you want to stage all the previous commits but not
commit them
-
--hard
- It removes the commit from your repository and from your working tree.
-
tag
- tagname branch
-
gc
- Cleanup unnecessary files and optimize the local repository
-
rebase
- Forward-port local commits to the updated upstream head
-
reflog
- Manage reflog information
-
Config
-
command alias
- git config --global alias.ci "commit"
-
remote repos
-
origin
- is the default remote repository name assigned to a repository that you create a clone from.
- git remote add somename git://example.com/dev-foo.git
-
Tips
-
Check out a tag version
- git branch branch_name tag_name
- git checkout branch_name
-
compact version
- git checkout -b branch_name tag_name
- Even though you can’t make changes to a tag, you can check
it out like you would a branch
- You’re not on a branch, so you can’t track changes