Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dotherightthing/2cb63688515790cf53a791c17d4bab3a to your computer and use it in GitHub Desktop.
Save dotherightthing/2cb63688515790cf53a791c17d4bab3a to your computer and use it in GitHub Desktop.
[Adding a development branch after pushing to master] #git

Adding a development branch after pushing to master

If you forget to create a development branch before developing, then need to patch master:

  1. Create a branch from the last commit
  2. Stash any uncommitted changes
  3. Reset the master branch to the last tagged release (or whenever)
  4. git push -f [email protected]:dotherightthing/reponame.git

If you try to do (4) via SourceTree then Github will complain that "github Updates were rejected because a pushed branch tip is behind its remote"

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