Skip to content

Commit be83c57

Browse files
authored
Merge pull request #1510 from HonkingGoose/add-caution-block-about-pushing-amended-commits
2 parents 44ed2ab + bcbc27a commit be83c57

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

book/02-git-basics/sections/undoing.asc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ Effectively, it's as if the previous commit never happened, and it won't show up
3939
The obvious value to amending commits is to make minor improvements to your last commit, without cluttering your repository history with commit messages of the form, ``Oops, forgot to add a file'' or ``Darn, fixing a typo in last commit''.
4040
====
4141

42+
[NOTE]
43+
====
44+
Only amend commits that are still local and have not been pushed somewhere.
45+
Amending previously pushed commits and force pushing the branch will cause problems for your collaborators.
46+
For more on what happens when you do this and how to recover if you're on the receiving end read <<_rebase_peril>>.
47+
====
48+
4249
[[_unstaging]]
4350
==== Unstaging a Staged File
4451

0 commit comments

Comments
 (0)