简体   繁体   中英

How to commit to own PR from other Computer?

I'm a bit stranded with github: I forked a repository on github a while ago and made up a new branch on my Notebook. I did some changes and then a pull request. Unfortunately my Notebook got broken and now I want to commit some changes into the PR from a new Computer. How do I get in my old branch, so that I just have to add/commit/push for the same PR from my new Computer?

I tried git fetch --all , but my branch isn't there.

\edit: I just delete the cloned fork and recloned it and then doing the steps written down here and it works.

In your new computer, you can checkout a pull request locally :

 git fetch origin pull/ID/head:BRANCHNAME
 git switch BRANCHNAME

The reason a normal fetch has not fetched your PR branch is because of the default refspec .

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

That would not fetch the pull/xx namespace.

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