Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
user-manual: clarify language about "modifying" old commits
author
J. Bruce Fields
<bfields@citi.umich.edu>
Mon, 26 Nov 2007 00:01:57 +0000
(19:01 -0500)
committer
J. Bruce Fields
<bfields@citi.umich.edu>
Mon, 26 Nov 2007 00:01:57 +0000
(19:01 -0500)
It's important to remember that git doesn't really allowing "editing" or
"modifying" commits, only replacing them by new commits. Redo some of
the language to make this clearer.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Documentation/user-manual.txt
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
81eb417
)
diff --git
a/Documentation/user-manual.txt
b/Documentation/user-manual.txt
index 547c9364b9a383469d9bf1ab6855ac5758754ab2..7fd3791b5ee64cc336695b511b4ccd1fe2663e41 100644
(file)
--- a/
Documentation/user-manual.txt
+++ b/
Documentation/user-manual.txt
@@
-1416,8
+1416,8
@@
with the changes to be reverted, then you will be asked to fix
conflicts manually, just as in the case of <<resolving-a-merge,
resolving a merge>>.
conflicts manually, just as in the case of <<resolving-a-merge,
resolving a merge>>.
-[[fixing-a-mistake-by-
ed
iting-history]]
-Fixing a mistake by
ed
iting history
+[[fixing-a-mistake-by-
rewr
iting-history]]
+Fixing a mistake by
rewr
iting history
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the problematic commit is the most recent commit, and you have not
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the problematic commit is the most recent commit, and you have not
@@
-1440,7
+1440,7
@@
Again, you should never do this to a commit that may already have
been merged into another branch; use gitlink:git-revert[1] instead in
that case.
been merged into another branch; use gitlink:git-revert[1] instead in
that case.
-It is also possible to
edit
commits further back in the history, but
+It is also possible to
replace
commits further back in the history, but
this is an advanced topic to be left for
<<cleaning-up-history,another chapter>>.
this is an advanced topic to be left for
<<cleaning-up-history,another chapter>>.
@@
-1977,7
+1977,7
@@
This can happen, for example, if you:
- use `git reset --hard` to remove already-published commits, or
- use `git commit --amend` to replace already-published commits
- use `git reset --hard` to remove already-published commits, or
- use `git commit --amend` to replace already-published commits
- (as in <<fixing-a-mistake-by-
ed
iting-history>>), or
+ (as in <<fixing-a-mistake-by-
rewr
iting-history>>), or
- use `git rebase` to rebase any already-published commits (as
in <<using-git-rebase>>).
- use `git rebase` to rebase any already-published commits (as
in <<using-git-rebase>>).
@@
-2472,11
+2472,11
@@
return mywork to the state it had before you started the rebase:
$ git rebase --abort
-------------------------------------------------
$ git rebase --abort
-------------------------------------------------
-[[
modify
ing-one-commit]]
-
Modify
ing a single commit
+[[
rewrit
ing-one-commit]]
+
Rewrit
ing a single commit
-------------------------
-------------------------
-We saw in <<fixing-a-mistake-by-
ed
iting-history>> that you can replace the
+We saw in <<fixing-a-mistake-by-
rewr
iting-history>> that you can replace the
most recent commit using
-------------------------------------------------
most recent commit using
-------------------------------------------------
@@
-2486,8
+2486,10
@@
$ git commit --amend
which will replace the old commit by a new commit incorporating your
changes, giving you a chance to edit the old commit message first.
which will replace the old commit by a new commit incorporating your
changes, giving you a chance to edit the old commit message first.
-You can also use a combination of this and gitlink:git-rebase[1] to edit
-commits further back in your history. First, tag the problematic commit with
+You can also use a combination of this and gitlink:git-rebase[1] to
+replace a commit further back in your history and recreate the
+intervening changes on top of it. First, tag the problematic commit
+with
-------------------------------------------------
$ git tag bad mywork~5
-------------------------------------------------
$ git tag bad mywork~5