scripts/git
Matteo Cypriani a5eca28a97 [git] cherry-move: use plumbing to list branches
Use git for-each-ref instead of git branch to check the existence of a
branch.
2011-07-01 15:52:05 +02:00
..
README [git] Add README 2011-07-01 15:40:56 +02:00
git-cherry-move [git] cherry-move: use plumbing to list branches 2011-07-01 15:52:05 +02:00

README

# git-cherry-move #

git-cherry-move is like git cherry-pick, but it moves the commit
instead of copying it.

It is designed to move a single commit from a branch head to another
branch head. It is the equivalent of git cherry-pick followed by git
reset.

Usage:
 git-cherry-move source_branch destination_branch [ reset-arg ]

reset-arg is passed as the first argument of reset, so pleas be careful!

To move the last commit of source_branch on top of destination_branch,
you can type the following:
 git-cherry-move source_branch destination_branch
After this, you will be on source_branch, the HEAD being on the parent
of the old source_branch head. The changes introduced by the moved
commit are not deleted from the file system (soft reset).

If you want these changes to be deleted (hard reset), use --hard as the
*last* argument:
 git-cherry-move source_branch destination_branch --hard

To activate the git cherry-move command, put the git-cherry-move script
in a directory in the PATH (for instance /usr/local/bin) and add an
alias:

 git config --global alias.cherry-move "\!sh -c 'git-cherry-move'"