简体   繁体   English

无法使用 Git 结帐其他分支机构

[英]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.

相关问题 如何使用 git 将 URL 获取到我当前分支的合并请求或拉取请求? - How can I get the URL to a merge request or a pull request of my current branch using git? Python GIT 结帐失败,原因是:退出代码(1) - Python GIT CHeckout failed due to: exit code(1) Cloud Run 中每个 git 分支的单独 URL - Separate URL for each git branch in Cloud Run GitLab 的唯一:更改和分支中的第一次提交 - GitLab's only:changes and the first commiit in a branch 如果远程和本地提交历史不同,如何 git 拉分支? - How to git pull a branch if remote and local commits history differs? CloudRun 无法发出出站 http(s) 请求 - 超时 - CloudRun can't make outbound http(s) requests - Timeout Airflow DAG 找不到要在 s3 上上传的本地文件 - Airflow DAG can't find local file to upload on s3 将存储库从一个 git 实例连同所有提交和分支历史记录一起移动到另一个实例 - Moving repository from one git instance to another along with all commit and branch histories Github 镜像:如何在推送时设置默认分支 - Github mirroring: How can I set default branch when pushing 无法通过 boto3 创建 S3 批处理作业 - 请求无效 - Can't create S3 batch job through boto3 - gets request invalid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM