Update organization of commits content

This commit is contained in:
James Skemp 2021-08-22 10:42:47 -05:00
parent 6ba765de72
commit e1bc681026
2 changed files with 12 additions and 11 deletions

View File

@ -92,17 +92,8 @@ git checkout a1b2c3~1 -- <file>
git commit -m "Message"
# Commit with a summary and detail. Additional -m parameters can be passed as needed.
git commit -m "Summary" -m "Details"
# Update the last commit's message.
git commit --amend -m "Message"
# Update the last commit's date (reflected on GitHub).
git commit --amend --no-edit --date="Fri Nov 6 20:00:00 2016 -0600"
# Add another file to the last commit. Uses the last message.
git add <file>
git commit --amend -C HEAD
git commit -m "Summary" -m "Details."
git commit -m "Summary" -m "Details." -m "Another line/paragraph of details."
# Add all changed files and commit. New files are not committed.
git commit -am "Message"

View File

@ -1,5 +1,15 @@
# Fixing commits
```bash
# Update the last commit's message.
git commit --amend -m "Message"
# Update the last commit's date (reflected on GitHub).
git commit --amend --no-edit --date="Fri Nov 6 20:00:00 2016 -0600"
# Add another file to the last commit. Uses the last message.
git add <file>
git commit --amend -C HEAD
# Revert the last commit.
git revert HEAD