diff options
author | Evelyn Huang <evhuang@google.com> | 2017-08-10 11:33:43 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-09-05 03:54:54 +0000 |
commit | 824c85c9a514aa32b508bffda8a18e834243085f (patch) | |
tree | cd28b99531392d300099c8f3b4a1a09a94270770 | |
parent | 0805a7e66a50ff07a48dec2400e8c8296f42c53f (diff) |
Documentation: Update Lesson2.md
Update Lesson2.md to include information about updating a commit after
it has been pushed to the remote repository.
Change-Id: Iebf86113b13d859d9c9e3db51e22ea44cb1144f6
Signed-off-by: Evelyn Huang <evhuang@google.com>
Reviewed-on: https://review.coreboot.org/20948
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r-- | Documentation/Lesson2.md | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/Lesson2.md b/Documentation/Lesson2.md index 55d81881ca..0263cedf4e 100644 --- a/Documentation/Lesson2.md +++ b/Documentation/Lesson2.md @@ -251,4 +251,31 @@ preferences. If you wish to do so, look at the "All configs for .bashrc" section on https://github.com/magicmonty/bash-git-prompt. Listed in that section are various lines that you can copy, uncomment and add to your .bashrc file to change the configurations. Example configurations include avoid fetching remote -status, and supporting versions of Git older than 1.7.10.
\ No newline at end of file +status, and supporting versions of Git older than 1.7.10. + +## Appendix: Miscellaneous Advice + +### Updating a commit after running git push: + +Suppose you would like to update a commit that has already been pushed to the +remote repository. If the commit you wish to update is the most recent +commit you have made, after making your desired changes, stage the files +(either using git add or in git cola), and amend the commit. To do so, +if you are using the command line, run "git commit --amend." If you are +using git cola, click on the gear icon located on the upper left side under +**Commit** and select **Amend Last Commit** in the drop down menu. Then, stage +the files you have changed, commit the changes, and run git push to push the +changes to the remote repository. Your change should be reflected in Gerrit as +a new patch set. + +If, however, the commit you wish to update is not the most recent commit you +have made, you will first need to checkout that commit. To do so, find the +URL of the commit on <https://review.coreboot.org> and go to that page; if +the commit is one that you previously pushed, it can be found by selecting +**My** and then **Changes** in the upper left corner. To checkout this commit, +in the upper right corner, click on **Download**, and copy the command listed +next to checkout by clicking **Copy to clipboard**. Then, run the copied +command in your coreboot repository. Now, the last commit should be the most +recent commit to that patch; to update it, make your desired changes, stage +the files, then amend and push the commit using the instructions in the above +paragraph.
\ No newline at end of file |