If you already have your develop branch pointing to your origin/develop
,
change it so that it points to upstream
:
git branch --set-upstream-to upstream/develop develop
If it does not already point to upstream, let's make it do so:
git checkout -b develop upstream/develop
Keep your upstream up-to-date with
git checkout develop && git pull
There are probably better workflows:
git checkout develop && git pull
git checkout -b feature develop
... commit some stuff ...
Push feature
branch to origin
:
git push -u origin feature
To get the most recent changes to develop into your branch:
git checkout develop && git pull
git checkout feature
git rebase develop
Fix any conflicts:
git add -A . # stage all changes
git rebase --continue # continue with rebase
Update remote tracking branch:
git push -f # rewrites history for anyone else that's pulled
If you'd like to squash changes before you commit -- only if you've rebased and not merged develop's changes.
git rebase -i <commit-before-your-first-commit-on-feature>
Then pick
the first and squash
the rest. Update the commit message:
Update remote tracking branch:
git push -f # rewrites history for anyone else that's pulled
Submit PR