Skip to content

Instantly share code, notes, and snippets.

@rudylattae
Last active August 29, 2015 14:06
Show Gist options
  • Save rudylattae/490790ad49931498f45a to your computer and use it in GitHub Desktop.
Save rudylattae/490790ad49931498f45a to your computer and use it in GitHub Desktop.
Git workflow - 1

Remote branch

git push origin master:refs/heads/next
git co --track origin/next

Start new feature

git co -b newfeat

Hack

touch file1.txt && git add file1.txt
git ci -m "Some new stuff"
touch fileA.txt && git add fileA.txt
git ci -m "Another file"

Roll your local changes on top of latest from remote next branch:

git co next
git pull
git co fewfeat
git rebase next

Interactive rebase - Flatten local commits:

git rebase -i next

In editor, squash all commits into first:

pick bbg4e3e Some new stuff
squash 7yas3d4 Another file

Editor reopens, write up an apropriate commit message:

[#44] New Feature
 * Did dome new stuff
 * Added another file (it was needed!)

Merge feature branch into next, push it to server, then delete the local branch

git co next
git merge newfeat
git push origin next
git br -d newfeat

Release

Merge next into master

git co master
git merge next

Tag release

git tag 0.0.1

Push to server

git push
git push --tags

Hotfixes for bugs

  • Fix on master
  • Tag as patch release
  • Push to server
  • Merge change into next

Learned from http://www.joslynesser.com/blog/archives/2010/09/06/git-workflow-for-small-teams/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment