Skip to content

Instantly share code, notes, and snippets.

@thibaut-d
Last active November 6, 2020 20:03
Show Gist options
  • Save thibaut-d/4f14949a62f73dea928180554a933426 to your computer and use it in GitHub Desktop.
Save thibaut-d/4f14949a62f73dea928180554a933426 to your computer and use it in GitHub Desktop.
Gitflow cheatsheet (without the Gitflow extension)

Gitflow cheat-sheet

Full description: https://medium.com/@thibaut.deveraux/yet-another-git-and-git-flow-cheatsheet-c1e721af3417

Feature branch life-cycle

Create the feature branch

git checkout -b feature_branch dev

Work on the branch then publish

git add .
git commit -m "message"
git push --set-upstream origin feature_branch

Repeat the cycle

git add .
git commit -m "message"
git push

When finished, merge and delete the branch

Create a pull request on Github to merge the remote branch.

Then merge the local branch:

git checkout dev
git fetch
git merge --no-ff feature_branch
git branch -d feature_branch
git push

Create a release

Create the version branch

git checkout dev
git checkout -b v0.0.x
git add .
git commit -m "comment"
git tag -a 0.0.x -m "comment"
git push --set-upstream --tags origin v0.0.x

Add some minor changes

version, etc.

git add .
git commit -m "comment"
git tag -a 0.0.x -m "comment"
git push

Merge with both master and dev

git checkout master
git merge --no-ff v0.0.x
git push
git checkout dev
git merge --no-ff v0.0.x
git branch -d v0.0.x
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment