[英]Can't checkout other branch's with Git
I was working on a branch 3, then in my team they started working on branch 4. When I tried to checkout branch 4, I couldn't find it.我在分支 3 上工作,然后在我的团队中,他们开始在分支 4 上工作。当我尝试结帐分支 4 时,我找不到它。 The "git branch -a" shows me only the branch 3.
“git branch -a”只显示了分支 3。
Any one have some ideas?任何人有一些想法?
Thanks for your responses.感谢您的回复。
This is an issue I have occasionally.这是我偶尔会遇到的问题。 Try first using git fetch to make sure you have a listing of all the upstream branches locally.
首先尝试使用 git fetch 以确保您拥有本地所有上游分支的列表。
If you're having issues with fetch, take a look at your.git/config file in your local repo, it should have a section that looks something like this:如果您在 fetch 方面遇到问题,请查看本地 repo 中的 your.git/config 文件,它应该有一个看起来像这样的部分:
[remote "origin"]
url = <repo uri>
fetch = +refs/heads/*:refs/remotes/origin/*
I tried:我试过了:
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
Before and it doesn't work.之前,它不起作用。 I repeated it just now and it worked.
我刚才重复了一遍,它奏效了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.