简体   繁体   中英

Rebasing into feature branch

If I'm working on a feature branch for a long period of time (weeks) and I want to regularly rebase master into my branch, should I always switch to master, pull latest, then switch back to the feature branch and rebase master?

I would simply do, assuming I am already on the feature branch:

git fetch && git rebase origin/master

You could, as commented, fetch only master with git fetch origin master:master , but I prefer fetching everything to have a complete local representation of the remote repository.

And since you are not working on master directly, you can ignore master , and rebase on top of origin/master , which was updated by the fetch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM