Skip to content

Instantly share code, notes, and snippets.

@rwcitek
Last active August 29, 2015 14:11
Show Gist options
  • Save rwcitek/5247d5dbee40881eb512 to your computer and use it in GitHub Desktop.
Save rwcitek/5247d5dbee40881eb512 to your computer and use it in GitHub Desktop.
The commands used to explain git flow in this video: http://vimeo.com/16018419
# the commands used to explain git flow in this video:
# http://vimeo.com/16018419
# pre-reqs:
# apt-get install git git-flow tig tmux
# run tmux in split screen (optional, but is what is done in video)
# in lower screen ... refreshing occasionally
tig
# in upper screen ...
mkdir gitflowtest
cd gitflowtest
git init
echo 'First Comit!' > README
cat -n README
git add README
git commit -a -m "Testing first commit"
## start using git flow
yes '' | git flow init
# development branch
sed -i -e 's/First/Second/' README
cat -n README
git add README
git commit -a -m "Second"
# feature branch - feature 1
git flow feature start feature-001
echo "Feature work 001" >> README
cat -n README
git commit -a -m "Feature"
sed -i -e '$s/$/ - more/' README
cat -n README
git commit -a -m "Feature"
# feature branch - feature 2
git flow feature start feature-002
sed -i -e '1s/$/ 1Feature 002/' README
cat -n README
git commit -a -m "Feature"
echo "More feature 002 work" >> README
cat -n README
git commit -a -m "More changes for feature 002"
# feature banch - feature 1
git flow feature finish feature-001
# feature banch - feature 2
git flow feature finish feature-002
cat -n README
echo 'First Comit!' > README
sed -i -e 's/First/Second/' README
sed -i -e '1s/$/ 1Feature 002/' README
echo "Feature work 001" >> README
sed -i -e '$s/$/ - more/' README
echo "More feature 002 work" >> README
cat -n README
git add README
git commit -a -m 'merge conflict resolved'
git flow feature finish feature-002
# release - 1.0
git flow release start 1.0
echo "Release 1.0" > RELEASE
echo -e '\nWe made it!' >> RELEASE
cat -n RELEASE
git add RELEASE
git commit -a -m "Release notes"
git flow release finish 1.0
# release made
# feature branch - feature 3
git flow feature start feature-003
echo "Doing some feature 003 work" >> README
cat -n README
git commit -a -m "Feature 003"
# hot fix - breakage
git flow hotfix start breakage
sed -i -e '1s/$/ - hotfix needed!/' README
cat -n README
git commit -a -m "hotfix fixed stuff"
git flow hotfix finish breakage
# Hotfix deployed. The world is saved again.
# feature branch - feature 3
git checkout feature/feature-003
echo "Even more feature 003 work" >> README
cat -n README
git commit -a -m "More work"
ls -l
git flow feature rebase
ls -l
git flow feature finish feature-003
# release branch - 2.0
git flow release start 2.0
sed -i -e 's/1/2/' RELEASE
cat -n RELEASE
git commit -a -m "Release notes"
git flow release finish 2.0
# Release 2.0 made
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment