based off of Vincent Driessen's workflow (PDF)
master
develop
release-$version
hotfix-$version
ticket-$number
git checkout develop; git pull origin develop
git checkout -b $feature
git checkout develop; git pull origin develop
git merge --no-ff $feature
or using a git alias
git config --global alias.join = merge --no-ff
git join $feature
This is for bug fixes and meta data (i.e. version bumps and changelog updates) in preparation for deployment. This branch should be titled "release-*" such as "release-1.0" and should be created from 'develop' branch when it is at an almost ready state.
IMPORTANT Any feature branches for post release need to wait before merging back into develop.
git checkout develop; git pull origin develop
# if there's a specific commit you want to branch off from
git checkout 529b8s
git checkout -b release-$version
merge to master (production ready / stable)
git checkout master
git merge --no-ff release-$version
git tag $version
merge back to develop
git checkout develop; git pull origin develop
git merge --no-ff release-$version
when done
git branch -d release-$version
git checkout master; git pull origin master
git checkout -b hotfix-$version
merge to master:
git checkout master; git pull origin master
git merge --no-ff hotfix-$version
git tag $version
if no release branch, merge to develop
git checkout develop; git pull origin develop
git merge --no-ff hotfix-$version
else if release branch, merge to release-$version {
git checkout release-$version; git pull origin release-$version
git merge --no-ff hotfix-$version
ams PROJECT should:
- update master, update develop
easily update 'develop' branch (git fetch origin/develop)
git stash
working_branch=[current_branch]
git checkout develop; git pull origin develop
git checkout $working_branch
git stash pop
git fetch
git log -p $branch..origin/$branch
git checkout develop; git pull origin develop
git checkout -b release-$version
git checkout develop; git pull origin develop
git merge release-$version
git checkout master; git pull origin master
git merge release-$version
bump version to 1.x
bump version to 1.1.x
git reset --hard
Destructive. You will lose unstashed / uncommited changes.
git cherry-pick # may need an alias to better handle
should be able to provide 2 hashes and grab those changes to current branch
example: git pluck $hash1..$hash2 git pluck $hash1 $hash2
git gc
branch="develop"
git config branch.$branch.remote=origin
git config branch.$branch.merge=refs/heads/master
git diff --staged
index / staging - staging area between your working directory and your repository