4 * Create a local repository from a public repository at `$URL`:
8 * Stage a (possibly new) file (or files) for the next commit:
12 * Remove a file (or files) with the next commit:
16 * Commit any local changes to the local repository:
18 $ git commit -a -m "$MESSAGE"
20 * Push any local commits to a public repository (e.g. `origin`):
27 * Update your local view of a public repository (e.g. `origin`):
31 * Merge new commits from another branch (e.g. the `origin/master`
32 branch tracking the `master` branch of the `origin` repository):
34 $ git merge origin/master
36 * Mark conflicts as resolved:
43 * Compare the current working directory to the last commit:
50 * Check your local state:
58 * Who wrote this line, and what were they thinking?
61 $ git show $COMMIT_HASH
63 Recovering old versions
64 =======================
66 * Undo local changes to `$FILES` since the last commit:
70 * Checkout `$FILES` as they were during `$COMMIT`:
72 $ git checkout $COMMIT -- $FILES
74 * Create a new commit backing out changes made by an old commit:
78 Setting up a repository
79 =======================
81 * Create a new repository in the current directory:
91 $ git push --tags origin
93 * Incorperate the tags into any releases. For example, the Git
94 project extracts [version information][git-version-gen] when you
95 [compile the project][git-makefile]. Most Python projects just
96 increment `package.__version__` by hand
97 (e.g. [pygit2][pygit2-version]).
100 [git-version-gen]: http://git.kernel.org/cgit/git/git.git/tree/GIT-VERSION-GEN
101 [git-makefile]: http://git.kernel.org/cgit/git/git.git/tree/Makefile
102 [pygit2-version]: https://github.com/libgit2/pygit2/blob/master/pygit2/version.py