Created
June 6, 2012 12:01
-
-
Save elentok/2881478 to your computer and use it in GitHub Desktop.
rebase test
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 | |
function run_git { | |
echo ================================= | |
cmd="git $1" | |
echo "$cmd" | |
echo $cmd | bash | |
git ra | |
echo ================================= | |
} | |
function commit { | |
echo "bla" > $1 | |
git add --all | |
git commit -m "added $1" | |
} | |
rm -rf repos | |
mkdir repos | |
cd repos | |
mkdir repo | |
cd repo | |
git init --bare | |
cd .. | |
git clone repo user1 | |
cd user1 | |
commit initial_commit | |
run_git "git push origin master" | |
git branch BranchA | |
git checkout BranchA | |
commit changeY | |
run_git "push origin BranchA" | |
git checkout master | |
git branch BranchB | |
git checkout BranchB | |
commit changeX | |
run_git "push origin BranchB" | |
commit changeZ | |
git ra | |
run_git "merge BranchA" | |
commit changeW | |
run_git "push origin BranchB" | |
git checkout BranchA | |
run_git "rebase BranchB" | |
run_git "push origin BranchA" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment