Checking out branch from a PR from a fork #21031
markcmiller86
started this conversation in
Share cool stuff
Replies: 1 comment 1 reply
-
|
Does this put you in the detached HEAD state? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes we want to work on a branch associated with a pull request from a fork but we DO NOT want to add a new remote for the fork. For example, suppose you want to work on #21023 in a git clone that lives on your own laptop. You can simply add the fork as a new remote. But, that adds some global git metadata that maybe you do not want to do.
So, here is how to checkout out #21023 without adding a remote.
This allows you to examine the code. You can compile the code, etc.
Now, if you wind up needing to push changes to the branch in the forked repo, you can either add the fork as a remote or you can try to push directly to the URL...
or
But this works only if the fork honors the
allow maintainters to editpermissions and and you use the same protocol (https://orssh://) as they do.Beta Was this translation helpful? Give feedback.
All reactions