Skip to content

Instantly share code, notes, and snippets.

@joxxoxo
Created June 25, 2014 09:22
Show Gist options
  • Save joxxoxo/3f4d4f5aeab1ca4920ff to your computer and use it in GitHub Desktop.
Save joxxoxo/3f4d4f5aeab1ca4920ff to your computer and use it in GitHub Desktop.
execute command for each revision in branch (do not count separate commits that were merged)
#!/bin/bash
(
base_dir=~/repo
cd $base_dir
# To test
# git reset master~10 --hard
git reset --hard
git clean -xdf
git fetch
revs=`git rev-list --first-parent --reverse master..origin/master`
for rev in $revs; do
echo $rev
done
git reset --hard
git clean -xdf
git rebase origin/master
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment