简体   繁体   中英

Forked project + Git branches syncing issues

I'm working on an open source project on GitHub and I have some issues. My origin/branch is up to date with the project and when I make pull requests from it, it compares with the good branch of the project. That part works wonders. Where it gets confusing is here: I have created numerous branches from the same point where I started working on my remote origin project. Then I made some changes and wanted to make a pull request.

The thing is: the new branches I created are too old to be compared with the project, GitHub tells me there's over 250 commits in the pull request I'm making. What I don't understand, since the branches (5) that I created come from the same point in time like the remote origin/branch that I'm working on, why are my branches too old ?

I'm working with someone who would like(and I concur) create pull requests for only a single feature. The idea behind the my many branches was to have the feedback as quickly as possible instead of opening one and waiting.

I tried updating my forked project using this : How to update GitHub forked repository? but I haven't yet found the proper solution for my branches and how to make sure this situation does not happen to me in the future.

You will need rebase forked copy. This happens when your fork is out of sync with remote upstream. Following helped me.

  • git checkout master
  • git fetch upstream
  • git checkout
  • git rebase master
  • git log master (check if commits from remote master are appearing)
  • git push -u origin -f (You need to do force push)

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