Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 6

How do I update my forked repository to match the master (updated after merge) I forked from?

I am probably missing something simple but I haven't found anything yet that definitively answers my question.  How do I update a forked repository to match the repository I forked from so that I have the current (merged) files?

 

So far I've only found that I would have to fork a new copy for the current (merged) files.  I can do this but if I do that for every update to the primary master (the repository I forked from), that would create a massive amount of forks (and branches maybe) unless I delete all the old versions.

 

Assistance please and thank you.

5 Replies
Community Manager
Message 2 of 6

Re: How do I update my forked repository to match the master (updated after merge) I forked from?

Hi @LaRose9548,

 

You can sync a fork with the upstream repository by adding that upstream repository as remote on your local machine and creating a merge commit.

 

Thanks!

Copilot Lvl 2
Message 3 of 6

Re: How do I update my forked repository to match the master (updated after merge) I forked from?

TYTYTY .. I knew there had to be a way .. :D
Community Manager
Message 4 of 6

Re: How do I update my forked repository to match the master (updated after merge) I forked from?

You're very welcome!

Copilot Lvl 2
Message 5 of 6

Re: How do I update my forked repository to match the master (updated after merge) I forked from?

I have followed the instructions in https://help.github.com/articles/syncing-a-fork/ however my repository ends up being one commit ahead of the upstream/master each time I do it. If I resync with a quickly changing master I get a bunch of commits that only pertain to the resyncs. Then when I do want to create a pull request I get all of those commits in the pull. For an example, check out https://github.com/plestedr/Ada_Drivers_Library currently identical to the master but still 8 commits ahead.

 

The only way I've found to work around this is to delete my repository and fork it again off of the upstream/master. That works but it seems like overkill. I tried rebasing on upstream/master, but that's not working, I don't think so, at least.

 

The online docs don't address this so I think I'm missing something. But I get the same results every time.

 

Hope y'all can point me to somewhere in the docs that can help.

 

Bob

wei
Pilot Lvl 1
Message 6 of 6

Re: How do I update my forked repository to match the master (updated after merge) I forked from?

My Github App solves this exact problem : )  Please give it a star if you find it useful.

 

https://github.com/wei/pull

 

🤖 a GitHub App built with probot that keeps your repository up-to-date with upstream changes via automated PRs.