Easier way to keep a git feature branch up to date

Well, git is really set up for wrapping things you do frequently into a script and then calling the script instead. There isn't a huge number of variations on the above. They all will require pulling the upstream branch, and then integrating your changes with the upstream's. Some things that may shorten it for you might be:

git checkout feature/foo
git fetch --all
git merge --into-name=develop origin/develop
git rebase develop

That way you can simply pull all the upstream branches in one shot without switching to the other branch. And rebasing is possibly an operation you may prefer over merging, but that's frequently a personal choice depending on how you want the history to look.


Why not make a script that would run the commands?

Create merge-develop.sh with text

#!/bin/bash
git checkout develop
git pull
git checkout feature/$1
git merge develop 
git push

Then simply run merge-develop.sh foo.

Tags:

Git