-
-
Notifications
You must be signed in to change notification settings - Fork 307
How to: keep your fork in sync #2663
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
Conversation
✅ Deploy Preview for conda-forge-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
docs/how-to/basics/fork-sync.md
Outdated
| 3. Pull from upstream: `git pull upstream main`. | ||
| - If this results in merge conflicts, abort with `git merge --abort` and hard-reset `main`. This WILL lose all the changes made in `main` that were not part of upstream. The command is: `git reset --hard upstream/main`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps that's not the right change to discuss this, but perhaps it would be more helpful to suggest:
git pull --rebase ...
This will also be the less nuclear option than hard reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can easily describe this in ways that doesn't lose work. For example:
git fetch upstream
git merge upstream/main
# in case of conflicts
git merge --abort
git checkout -b separate_branch_to_park_changes
git checkout main
git reset --hard upstream/mainAnd then we can also describe how to rebase the branch (which is often the cause of the conflicts due to rerender commits):
git checkout separate_branch_to_park_changes
# an "interactive" rebase, hence -i; ensure you did `git fetch upstream` before
git rebase -i upstream/main
# remove unwanted commits from rebase TODO file that should open, especially rerenders; then save and exit
# git will then replay your commits on top of the main branch; for any conflict, decide between:
# * fixing it, then `git add .` & `git commit ...` & `git rebase --continue`
# * skipping the commit `git rebase --skip`There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check 244a23f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that basically a very roundabout way of git pull --rebase, though? I mean, besides using a separate branch.
Co-authored-by: Michał Górny <mgorny@gentoo.org>
|
@h-vetinari, can you take another look / approve? This one is needed in the other PRs because otherwise Docusaurus will complain about a missing doc. |
h-vetinari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two nits
h-vetinari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed the click on the second one before...
Co-authored-by: h-vetinari <h.vetinari@gmx.com>
|
Applied, @h-vetinari. PTAL 🙏 |
h-vetinari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more thing that doesn't make sense IMO
Co-authored-by: h-vetinari <h.vetinari@gmx.com>
h-vetinari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one last nit. Thanks for the patience on this
Co-authored-by: h-vetinari <h.vetinari@gmx.com>

PR Checklist:
docs/orcommunity/, you have added it to the sidebar in the corresponding_sidebar.jsonfileNeeded by #2661, #2660 and others to come.