Skip to content

Instantly share code, notes, and snippets.

@Hiroshiba
Last active June 8, 2017 13:56
Show Gist options
  • Save Hiroshiba/b07cd3ea625fd755d13c5dbf510775cd to your computer and use it in GitHub Desktop.
Save Hiroshiba/b07cd3ea625fd755d13c5dbf510775cd to your computer and use it in GitHub Desktop.
git周りのスニペット
# 歴史にcommitAを持つブランチに関して、commitAよりあとのコミットをcommitBに付け替える
# for b in `git branch --contains commitA --sort=-committerdate`; do git rebase --onto commitB commitA $b; done
function git-rebase-related-branch () {
for b in `git branch --contains $1 --sort=committerdate`; do
git rebase --onto $2 $1 $b
sleep 1s
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment