Git: How to keep local feature branch updated with changes made in dev?
Periodically:
λ git checkout dev
λ git pull origin dev
λ git checkout myfeaturebranch
λ git merge dev
Running git rebase dev
while on the feature branch should do the trick (update local dev from origin first, if necessary).
That will replay your changes from the feature branch onto dev, then sets the feature head to be the head of the new history.
Note: Only rebase
if your feature branch commits have not yet been pushed. It will rewrite your history. There are some caveats with rebase
which may or may not be worth the risk.