git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <cp.packham@gmail.com>
To: schacon@gmail.com
Cc: git@vger.kernel.org, jnareb@gmail.com, bkorb@gnu.org,
	Chris Packham <judge.packham@gmail.com>
Subject: [gitbook PATCH] add notes on re-writing history
Date: Tue,  2 Mar 2010 15:07:14 -0800	[thread overview]
Message-ID: <1267571234-13565-1-git-send-email-judge.packham@gmail.com> (raw)
In-Reply-To: <a038bef51003021336g3ab0b4f6vba2738a18a92dd36@mail.gmail.com>

Add a note on the consequences of re-writing a repositories history in
"Undoing in Git - Reset, Checkout and Revert/Fixing a mistake by
modifying a commit" and "Modifying your History".
---
I didn't sucessfully get the ruby gems installed on openSUSE 11.2 (problems
installing ultraviolet) so if someone who does have a working environment could
have a look and maybe do a bit of polishing that would be helpful.

 .../0_ Redoing_Git_Reset_and_Revert.markdown       |    6 +++++-
 .../0_Changing_History.markdown                    |   20 ++++++++++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/text/21_Redoing_Git_Reset_and_Revert/0_ Redoing_Git_Reset_and_Revert.markdown b/text/21_Redoing_Git_Reset_and_Revert/0_ Redoing_Git_Reset_and_Revert.markdown
index b37245d..8b876f2 100644
--- a/text/21_Redoing_Git_Reset_and_Revert/0_ Redoing_Git_Reset_and_Revert.markdown	
+++ b/text/21_Redoing_Git_Reset_and_Revert/0_ Redoing_Git_Reset_and_Revert.markdown	
@@ -43,7 +43,11 @@ fundamentally different ways to fix the problem:
     never do this if you have already made the history public;
     git does not normally expect the "history" of a project to
     change, and cannot correctly perform repeated merges from
-    a branch that has had its history changed.
+    a branch that has had its history changed. If you do re-write
+    a repositories history anyone else who has cloned the
+    repository will need manually correct the problem on their
+    clone see the "RECOVERING FROM UPSTREAM REBASE" section
+    in linkgit:git-rebase[1].
 
 #### Fixing a mistake with a new commit ####
 
diff --git a/text/25_Changing_Your_History/0_Changing_History.markdown b/text/25_Changing_Your_History/0_Changing_History.markdown
index b569f46..160c838 100644
--- a/text/25_Changing_Your_History/0_Changing_History.markdown
+++ b/text/25_Changing_Your_History/0_Changing_History.markdown
@@ -1,6 +1,22 @@
 ## Modifying your History ##
 
-Interactive rebasing is a good way to modify individual commits.
+There are several ways to re-write the history of a repository. All of
+these can cause problems for commits that have already been pushed to a
+remote repository. If you do re-write a repositories history anyone else
+who has cloned the repository will need manually correct the problem on
+their clone see the "RECOVERING FROM UPSTREAM REBASE" section in
+linkgit:git-rebase[1].
 
-linkgit:git-filter-branch[1] is a good way to edit commits en masse.
+The simplest method is to use "git commit --amend" to modify the last commit.
+This is useful to correct a commit message, or make a simple update to a
+commit before pushing.
+
+Interactive rebasing is a good way to modify multiple commits. Commits can
+be combined by squashing, changed by editing or removed entirely.
+
+linkgit:git-filter-branch[1] is a good way to edit commits en masse. This is
+useful where a whole component needs to be removed from a project. For
+example removing a subsystem which is licenced under an incompatible
+opensource licence. Or it can be used to alter the commit authorship without
+changing the code.
 
-- 
1.7.0.1

  reply	other threads:[~2010-03-02 23:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 21:15 failed to push Bruce Korb
2010-03-01 21:23 ` Bruce Korb
2010-03-01 21:42   ` Chris Packham
2010-03-01 22:00     ` Bruce Korb
2010-03-01 22:04       ` SUCCESS -- " Bruce Korb
2010-03-02 11:44       ` Erik Faye-Lund
2010-03-02 19:09       ` Jakub Narebski
2010-03-02 21:36         ` Chris Packham
2010-03-02 23:07           ` Chris Packham [this message]
2010-03-01 21:27 ` Jacob Helwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1267571234-13565-1-git-send-email-judge.packham@gmail.com \
    --to=cp.packham@gmail.com \
    --cc=bkorb@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=judge.packham@gmail.com \
    --cc=schacon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).