Created
October 24, 2008 18:31
-
-
Save chrisk/19541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Pushes the earliest commit from the current branch (using git-svn dcommit), | |
# keeping your other unpushed commits intact and updating the pushed commit | |
# with git-svn metadata. | |
# | |
# Usage: | |
# git pushone | |
# | |
rev=$(git rev-list --reverse HEAD...trunk | head -n1) | |
# turn off the pager | |
git config pager.log false | |
echo -e "\033[1mCommit to push:\033[0m" | |
git log --pretty=tformat:"%Cred%h%Creset %s" $rev^..$rev | |
read -n1 | |
echo -e "\033[1mgit svn dcommit $rev --no-rebase\033[0m" | |
git svn dcommit $rev --no-rebase | |
echo -e "\033[1mgit svn rebase\033[0m" | |
git svn rebase | |
# reset pager to default | |
git config --unset pager.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment