Git fetch / rebase master branch when another branch is issued

Currently, when I am working on my local function branch to get the latest changes, I need to do the following:

git checkout master git fetch git rebase git checkout my-feature git rebase master 

Is there a simpler solution to just pull changes to the master branch without switching to it?

+4
source share
2 answers

I think that Git will always switch to master behind the scene to do a rebase (given that rebase starts by checking the destination branch:
see " git rebase , tracking" local "and" remote " ").

You can use the git pull --rebase :

 git pull --rebase master:master git checkout my-feature git rebase master 
+1
source

I think you can just do git fetch followed by git rebase origin/master . This should rebuild your topic thread against the wizard. I don’t know if sampling is really required.

+1
source

All Articles