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