5/16/2017 - 8:45 PM

Git rebase and push

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