| 10 | |
| 11 | Next we modify a file so we can commit a change: |
| 12 | |
| 13 | {{{ echo "Some junk" >> README }}} |
| 14 | |
| 15 | To see a list of modifies files: |
| 16 | |
| 17 | {{{ git status }}} |
| 18 | |
| 19 | should produce something like |
| 20 | |
| 21 | {{{ |
| 22 | # On branch master |
| 23 | # Changed but not updated: |
| 24 | # (use "git add <file>..." to update what will be committed) |
| 25 | # (use "git checkout -- <file>..." to discard changes in working directory) |
| 26 | # |
| 27 | # modified: README |
| 28 | # |
| 29 | |
| 30 | }}} |
| 31 | |
| 32 | To commit all local changes: |
| 33 | {{{ |
| 34 | git commit -a -m "I did some stuff" |
| 35 | }}} |
| 36 | |
| 37 | If you had multiple changed files that you wanted to commit seperately, you would do |
| 38 | {{{ |
| 39 | git add README |
| 40 | git commit -m "I commit stuff" |
| 41 | }}} |
| 42 | LESSON: Git only commits files you have added already. The -a flag lets you be lazy and say "go ahead and add all modified files" when you are commiting. |