简体   繁体   中英

Forked branch is updated while being 1 commit behind the master branch

I am working on a forked repo.

I pushed a commit yesterday which was merged with the master branch a couple of hours later. I kept working on my fork without pulling in the new merged master, so my local files are technically "1 commit behind".

I usually git pull upstream to keep my local files up-to-date, but this time my local files are updated and I do not want to lose my changes because I will commit them right after the git pull upstream .

My question is: How do I merge my local repo with the master repo while keeping my changes so I can then commit and push the updates files?

Probably you are looking for:

git pull --rebase upstream master

This will update your repo and put your changes ahead.

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