Skip to content

Instantly share code, notes, and snippets.

@f3ew
Created March 27, 2017 21:35
Show Gist options
  • Save f3ew/a4e36e4b95265e5f6a8d99bb86a82c1a to your computer and use it in GitHub Desktop.
Save f3ew/a4e36e4b95265e5f6a8d99bb86a82c1a to your computer and use it in GitHub Desktop.
# Initialise git repo
git clone project.git
cd project
# Current branch is now master
# Make one branch per environment, aka four tags pointing to the same commit
git branch develop
git branch test
git branch acceptance
git branch production
# Switch to develop
git checkout develop
# Make a feature branch and checkout feature
git checkout -b feature
git commit -m 'TICKETID New code here' some/files/which/changed some/more/files/
git checkout develop
# Make feature part of develop
git merge feature
git checkout test
# Pull a single commit from develop into test
git cherry-pick <sha1 of newer git commit on develop>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment