Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cloudshooterhuman/20d27c5f206ee5f629ccc89db69c9c2e to your computer and use it in GitHub Desktop.

Select an option

Save cloudshooterhuman/20d27c5f206ee5f629ccc89db69c9c2e to your computer and use it in GitHub Desktop.
git by recurse
mkdir alpha
cd alpha
mkdir data
printf 'a' > data/letter.txt
git init
git add data/letter.txt
printf '1234' > data/number.txt
git add data
printf '1' > data/number.txt
git add data
git commit -m 'a1'
printf '2' > data/number.txt
git add data/number.txt
git commit -m 'a2'
git checkout c4b7aea
printf '3' > data/number.txt
git add data/number.txt
git commit -m 'a3'
git branch deputy
git checkout master
printf '789' > data/number.txt
git checkout deputy
printf '2' > data/number.txt
git checkout deputy
git merge master
git checkout master
git merge deputy
printf '4' > data/number.txt
git add data/number.txt
git commit -m 'a4'
git checkout deputy
printf 'b' > data/letter.txt
git add data/letter.txt
git commit -m 'b3'
git checkout master
git merge deputy
git checkout deputy
printf '5' > data/number.txt
git add data/number.txt
git commit -m 'b5'
git checkout master
printf '6' > data/number.txt
git add data/number.txt
git commit -m 'b6'
git merge deputy
printf '11' > data/number.txt
git add data/number.txt
git commit -m 'b11'
git rm data/letter.txt
git commit -m '11'
git rm data/letter.txt
git commit -m '11'
cd ..
cp -R alpha bravo
cd alpha
git remote add bravo ../bravo
cd ../bravo
printf '12' > data/number.txt
git add data/number.txt
git commit -m '12'
cd ../alpha
git fetch bravo master
git merge FETCH_HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment