commit Commit message on command line $ git commit -m 'adds some functionality' Each commit gets a SHA (long or short) d670460b4b4aece5915caf5c68d12f560a9fe3e4
is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: script.rb Untracked files: (use "git add <file>..." to include in what will be committed) config.yaml
been committed) $ git reset {SHA} {flename} Reset a single fle from the head of the current branch $ git reset HEAD benchmarks.rb Reset all fles from the head of the current branch $ git reset HEAD
your working directory $ git checkout {SHA} {flename} Retrieve a fle from the HEAD of the current branch $ git checkout benchmarks.rb Retrieve a fle from any commit in the repository $ git checkout 085bb3b benchmarks.rb
commit 8b2716e0151ed6efaa1c0789b5e8920d9481fe5c make broken test pass commit cd55e5b78d1339927fef898f8f51f6ac688027bb fx typo commit 92efac1f814b2a02b554ac694792f51488ca2762 Added new feature
refactor based on code review • e36c9e6 HEAD@{1}: commit: refactor based on code review • 8b2716e HEAD@{2}: commit: make broken test pass • cd55e5b HEAD@{3}: commit: fix typo • 92efac1 HEAD@{4}: commit: my commit message
changes More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical Use the imperative present tense in these messages. In other words, use commands. Instead of "I added tests for" or "Adding tests for," use "Add tests for."