Skip to content

Instantly share code, notes, and snippets.

@tushar-borole
Last active August 7, 2018 08:42
Show Gist options
  • Save tushar-borole/9fcf731d067385037e2438e1782b1431 to your computer and use it in GitHub Desktop.
Save tushar-borole/9fcf731d067385037e2438e1782b1431 to your computer and use it in GitHub Desktop.
Git rebase and push
#Keep your local branch in sync with the latest commits in master. When opening a pull request, you must rebase off the latest master before merging. Rebase several times a day to minimize merge conflicts and to keep your code current. In your feature/chore/bug branch, grab the latest master and rebase:
git fetch origin master && git rebase --interactive origin/master
#Then you’ll need to change the lines for each commit message you don’t want to show from ‘pick’ to ‘squash’.
# Once any conflicts are resolved:
git push --force origin feature-branch-name
#Force pushing should only be done to a feature branching, where only you created commits. Never force push to master (ever, ever).
git pull orgin master
git pull pantheon master
git push pantheon master:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment