Skip to content

Instantly share code, notes, and snippets.

@robbdempsey
Last active January 4, 2016 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robbdempsey/00865afa60d162afde1f to your computer and use it in GitHub Desktop.
Save robbdempsey/00865afa60d162afde1f to your computer and use it in GitHub Desktop.

Merging and tagging on long running branch

  1. Define a branch and a tag that will be your long-running-branch and be stable. (i.e. long-running-branch-stable lrb)
  2. Each developer working on the long running branch should do feature work on their own branch. (ie. robbdempsey/feature2)
  3. When you are ready to merge changes from a developer feature branch, Get the latest branches and tags from remote
    • git pull
    • When someone else has merged, tagged and pushed to github/stash you will need to pull those changes local
  4. Merge in your changes
    • git checkout long-running-branch-stable
    • git merge --no-ff [my-branch]
  5. Fix any conflicts and confirm merge works with any tests available
  6. tag your commit (try to follow semver)
    • git tag -a lrb-v1.X.X -m 'simple description'
  7. push your changes
    • git push origin long-running-branch-stable --follow-tags

Create a branch from a tag

`git checkout -b [newbranch] lrb-v1.2.0`

Rebase your work with long-running-branch-stable

  1. On your local branch, Commit/Stash your changes
  2. rebase your local branch from a tag on long-running-branch-stable
    • git rebase lrb-v1.2.1

helpful commands

git tag --column // list everything in column form

git log --pretty=oneline

git log --decorate --all --oneline — graph

git merge --no-ff [my-branch] // preserves commit history

git push origin --delete <branchName>

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