From da5d9a32f7f862b661f35405891df4c890b9aff0 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Sat, 29 Aug 2020 13:40:08 +0200 Subject: [PATCH 1/3] Add caution: don't amend pushed commits --- book/02-git-basics/sections/undoing.asc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/02-git-basics/sections/undoing.asc b/book/02-git-basics/sections/undoing.asc index 8d6403ac4..c84ee48e3 100644 --- a/book/02-git-basics/sections/undoing.asc +++ b/book/02-git-basics/sections/undoing.asc @@ -39,6 +39,12 @@ Effectively, it's as if the previous commit never happened, and it won't show up 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''. ==== +[CAUTION] +==== +Only amend commits that are still local and have not been pushed somewhere. +Amending previously pushed commits, and force pushing the branch will cause problems for your collaborators. +==== + [[_unstaging]] ==== Unstaging a Staged File From fd1a924124dde6edfc2e8eea3f071a401992ac7e Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Mon, 7 Sep 2020 17:58:16 +0200 Subject: [PATCH 2/3] Change CAUTION -> NOTE --- book/02-git-basics/sections/undoing.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/02-git-basics/sections/undoing.asc b/book/02-git-basics/sections/undoing.asc index c84ee48e3..0fa508471 100644 --- a/book/02-git-basics/sections/undoing.asc +++ b/book/02-git-basics/sections/undoing.asc @@ -39,7 +39,7 @@ Effectively, it's as if the previous commit never happened, and it won't show up 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''. ==== -[CAUTION] +[NOTE] ==== Only amend commits that are still local and have not been pushed somewhere. Amending previously pushed commits, and force pushing the branch will cause problems for your collaborators. From bcbc27adbcbfca1c1fc67b3f039cdd566c48397c Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Mon, 7 Sep 2020 18:12:35 +0200 Subject: [PATCH 3/3] Remove comma and add link to rebase_peril --- book/02-git-basics/sections/undoing.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/02-git-basics/sections/undoing.asc b/book/02-git-basics/sections/undoing.asc index 0fa508471..0589ea9e6 100644 --- a/book/02-git-basics/sections/undoing.asc +++ b/book/02-git-basics/sections/undoing.asc @@ -42,7 +42,8 @@ The obvious value to amending commits is to make minor improvements to your last [NOTE] ==== Only amend commits that are still local and have not been pushed somewhere. -Amending previously pushed commits, and force pushing the branch will cause problems for your collaborators. +Amending previously pushed commits and force pushing the branch will cause problems for your collaborators. +For more on what happens when you do this and how to recover if you're on the receiving end read <<_rebase_peril>>. ==== [[_unstaging]]