Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe how to sync a fork with upstream in Github #155

Closed
revodavid opened this issue Oct 25, 2019 · 7 comments
Closed

Describe how to sync a fork with upstream in Github #155

revodavid opened this issue Oct 25, 2019 · 7 comments

Comments

@revodavid
Copy link

This process, using only Github's PR process and not requiring the git command line, works:
https://twitter.com/revodavid/status/1187435324353302534

@jtr13
Copy link
Contributor

jtr13 commented Mar 31, 2022

Hi David! Not to rain on your parade (> 2 yrs later no less) but this method does not have the @jennybc stamp of approval. See: https://happygitwithr.com/upstream-changes.html#no-you-cant-do-this-via-github-1 I believe the "fatal flaws" are that this method messes up the commit history in a way that matters a lot to people who know a lot more about git than I do. 😄

@revodavid
Copy link
Author

GitHub now has a "Fetch Upstream" action which is what I use these days. Might be worth trying that to see if it preserves the commit history in a suitable way.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@jtr13
Copy link
Contributor

jtr13 commented Mar 31, 2022

Oh wow, I didn't know about that. So you click "Fetch Upstream" and then pull from your fork (rather than upstream) to stay updated?

@revodavid
Copy link
Author

Yes, that's correct -- the upstream changes get merged into your fork (in your GitHub repo), which you can then sync as usual.

@jtr13
Copy link
Contributor

jtr13 commented Mar 31, 2022

Thanks!

@powderflask
Copy link

Good one! I was here to leave the same comment. This new process on Github makes it very easy to keep branches synced with upstream (so long as you follow Happy Git advice and never add your own changes to forked branches!). Would be helpful to update the section mentioned above to include this workflow.

@jennybc
Copy link
Owner

jennybc commented Jun 14, 2022

Thanks all for highlighting that it is now possible to update the fork in the web UI. I have adjusted this part of Happy Git accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants