Skip to content

Commit

Permalink
Edited previous commit to suit my style.
Browse files Browse the repository at this point in the history
  • Loading branch information
blynn committed Jul 8, 2011
1 parent 10c69aa commit 4b9befa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
35 changes: 18 additions & 17 deletions en/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ Want to include a few more edits in that last commit? Then make those edits and

=== ... And Then Some ===

Let's suppose the previous problem is ten times worse. After a lengthy session you've made a bunch of commits. But you're not quite happy with the way they're organized, and some of those commit messages could use rewording. Then type:
Suppose the previous problem is ten times worse. After a lengthy session you've
made a bunch of commits. But you're not quite happy with the way they're
organized, and some of those commit messages could use rewording. Then type:

$ git rebase -i HEAD~10

Expand All @@ -37,40 +39,39 @@ and the last 10 commits will appear in your favourite $EDITOR. A sample excerpt:
pick a311a64 Reordered analogies in "Work How You Want"
pick 100834f Added push target to Makefile

Then:
Older commits precede newer commits in this list, unlike the `log` command.
Here, 5c6eb73 is the oldest commit, and 100834f is the newest. Then:

- Remove commits by deleting lines.
- Remove commits by deleting lines. Like the revert command, but off the
record: it will be as if the commit never existed.
- Reorder commits by reordering lines.
- Replace `pick` with:
* `edit` to mark a commit for amending.
* `reword` to change the log message.
* `squash` to merge a commit with the previous one.
* `fixup` to merge a commit with the previous one and discard the log message.

Commits are listed with the oldest one at the top of the list, and the newest one
at the bottom of the list. ie in the previous example, 5c6eb73 is the oldest commit,
and 5c6eb73 is the newest commit.

When doing a squash, the marked commit is "squashed" into the commit higher up
the list (use the mnemonic "squash up" to remember this). For example, this
would result in a311a64 being "squashed" into 5c6eb73:
For example, we might replace the second `pick` with `squash`:

pick 5c6eb73 Added repo.or.cz link
squash a311a64 Reordered analogies in "Work How You Want"
pick 100834f Added push target to Makefile

When *squash* is used, both log messages will appear in $EDITOR, allowing you
to reword/combine the log messages; *fixup* will discard the log message.

Save and quit. If you marked a commit for editing, then
run:
After we save and quit, Git merges a311a64 into 5c6eb73. Thus *squash* merges
into the next commit up: think ``squash up''.

$ git commit --amend
Git then combines their log messages and presents them for editing. The
command *fixup* skips this step; the squashed log message is simply discarded.

Otherwise, run:
If you marked a commit with *edit*, Git returns you to the past, to the oldest
such commit. You can amend the old commit as described in the previous section,
and even create new commits that belong here. Once you're pleased with the
``retcon'', go forward in time by running:

$ git rebase --continue

Git replays commits until the next *edit*, or to the present if none remain.

So commit early and commit often: you can tidy up later with rebase.

=== Local Changes Last ===
Expand Down
2 changes: 1 addition & 1 deletion en/preface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ I'm humbled that so many people have worked on translations of these pages. I
greatly appreciate having a wider audience because of the efforts of those
named above.

Dustin Sallings, Alberto Bertogli, James Cameron, Douglas Livingstone, Michael Budde, Richard Albury, Tarmigan, Derek Mahar, Frode Aannevik, Keith Rarick, Andy Somerville, Ralf Recker, Øyvind A. Holm, Miklos Vajna, Sébastien Hinderer, Thomas Miedema, Joe Malin, and Tyler Breisacher contributed corrections and improvements.
Dustin Sallings, Alberto Bertogli, James Cameron, Douglas Livingstone, Michael Budde, Richard Albury, Tarmigan, Derek Mahar, Frode Aannevik, Keith Rarick, Andy Somerville, Ralf Recker, Øyvind A. Holm, Miklos Vajna, Sébastien Hinderer, Thomas Miedema, Joe Malin, Tyler Breisacher, and Sonia Hamilton contributed corrections and improvements.

François Marier maintains the Debian package originally created by Daniel
Baumann.
Expand Down

0 comments on commit 4b9befa

Please sign in to comment.