标签云

微信群

扫码加入我们

WeChat QR Code


git fetch origin & try again

2018年10月23日47分28秒

Hi thanks for your response. I've tried that already, I've updated my question. Would the way be pushed to the repo have anything to do with it?

2018年10月23日47分28秒

Could you show [remote "origin"] section of the .git/config file?

2018年10月23日47分28秒

Done, see Edit 3

2018年10月23日47分28秒

Cool, but maybe it had more sense to use refs/remotes/bitbucket/* instead of refs/remotes/origin/*.

2018年10月23日47分28秒

This fixed my ongoing branching issue in Git that I had for weeks. Suddenly all the git remote update stuff actually started working. Thanks!

2018年10月23日47分28秒

For some reason, it looked like: fetch = +refs/heads/master:refs/remotes/origin/master for me. Replacing master with * fixed my problem.

2018年10月23日47分28秒

The file you need to edit is .git/config

2018年10月23日47分28秒

This is very usefull if you have converted a shallow clone to an unshallow.

2018年10月23日47分28秒

kan Do you know why this sometimes happens? It just happen to me when git clone a project. I don't recall having done anything special with my local git.

2018年10月23日47分28秒

I'm using the GitHub client on Win and sometimes it doesn't update the remote branches. The first line "git remote update" works like a charm. Easy & clean

1970年01月01日00分03秒

after git remote update I can see the new branch in UI . Thanks

2018年10月23日47分28秒

It didn't help.

2018年10月23日47分28秒

Did not work for me :(

2018年10月23日47分28秒

I think I had aleady successfully fetched the branch but just needed to see it listed with git branch -r. On git-scm.com/docs/git-branch it says "Option -r causes the remote-tracking branches to be listed, and option -a shows both local and remote branches". git remote update fetches all branches of all remotes listed in git remote -v.

2018年10月23日47分28秒

Was spending so much time to find this answer. This worked without any problem. Thanks. :)

2018年10月23日47分28秒

Worked for me as well, pretty strange that this solved it

2018年10月23日47分28秒

git remote -v will show you your remotes so you can get hold of the url, git remote rm origin will remove it, git remote add origin <url> will re-add it.

2018年10月23日47分28秒

Thanks! You're answer actually fixes the issue easily and seems like the correct way to do it. But you should add that the config file is in .git/config, so people can find it.

2018年10月23日47分28秒

Ahh you did. Maybe just highlight the path...

2018年10月23日47分28秒

you can edit the configuration with git config -e

2018年10月23日47分28秒