Can't seem to checkout this pull request anymore
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I'm trying to git checkout pr/145

I've followed the instructions here:

But I keep getting this error and I'm never able to get pr/145.

I was able to get it before, but now it stopped working and I can't figure out why.

awarded to ochi

Crowdsource coding tasks.

1 Solution

Winning solution

those two remotes should not be stored in the same namespace because your branch name is correct in both of them - just put it in another namespace e.g. "pr"

    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly

[remote "origin"]
    url =
    fetch = +refs/heads/*:refs/remotes/origin/*

[remote "pr"]
    url =
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

[branch "master"]
    remote = origin
    merge = refs/heads/master
@ochi why do these instructions from github place the 2 remotes in the same namespace then?
akshatpradhan over 6 years ago
Also, I'm still not getting the most recent updates from pr/145. Look at the commit message I'm locally seeing: And compare it to the last commit (been there button becomes un-been) made in the pull request:
akshatpradhan over 6 years ago
really I don't know :) I did it like they want it and stumped upon same bug as you i switch to another namespace and it works :) when I find why it is I will tell you :)
ochi over 6 years ago
please paste output of that command git log --graph --color --all --decorate --oneline
ochi over 6 years ago
I get this "ambiguous error" after deleting the branch pr/145 locally from my machine. Perhaps a clue?
akshatpradhan over 6 years ago
It seems that you pushed pr/145 into origin so now it's in both places - calling git branch -a just after checkout of fresh copy of your repo shows that. And that's why git warns you that it don't know where to look for it - cause with that configuration there are 2 paths that are correct for pr/145
ochi over 6 years ago
ok, so I just did a git fetch origin && git fetch pr and that seemed to fix the issue. Thank you!
akshatpradhan over 6 years ago