diff options
author | Junio C Hamano <junkio@cox.net> | 2007-03-22 02:54:59 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-22 02:56:53 -0700 |
commit | a1bf91e081de236af34bf8acd484881ce146fc93 (patch) | |
tree | 3a4d17c1ddca4bf1c3c63f048d1f54cbbc5e1d6f /git-ls-remote.sh | |
parent | 1d848f643cd8ba86044d729d08d6866425c1539e (diff) | |
download | git-a1bf91e081de236af34bf8acd484881ce146fc93.tar.gz |
git-rebase: make 'rebase HEAD branch' work as expected.
When you want to amend the commit message of 3 commits before
the tip of the current branch, say 'master',
A--B--C--D--E(master)
it is sometimes handy to make your head detached at that commit
with:
$ git checkout HEAD~3 ;# check out B
$ git commit --amend ;# without modifying contents...
to create:
.B'(HEAD)
/
A--B--C--D--E(master)
and then rebase 'master' branch onto HEAD with this:
$ git rebase HEAD master
to result in:
.B'-C'-D'-E(master=HEAD)
/
A--B--C--D--E
However, the current code interprets HEAD after it switches to
the branch 'master', which means the rebase will not do
anything. You have to say something unwieldly like this
instead:
$ git rebase $(git rev-parse HEAD) master
This fixes it by expanding the $onto commit name before
switching to the target branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-ls-remote.sh')
0 files changed, 0 insertions, 0 deletions