无法看到远程分支,与.git / config的问题? [英] Can't see remote branch, problems with .git/config?
问题描述
我感觉这可能是因为我的.git / config文件不正确。
目前我有这个...
[remoteorigin]
url = git@bitbucket.org:user / project.git
fetch = + refs /头/主:refs / remotes / origin / master
fetch = + refs / heads / testing:refs / remotes / origin / testing
fetch = + refs / heads / uat:refs / remotes / origin / uat
fetch = + refs / heads / release-1.9:refs / remotes / origin / release-1.9
我尝试了git remote update& git fetch origin,但都未能获得新的分支
我记得主演这个问题我看不到我的远程分支,并在旧笔记本电脑上将我的配置更改为如下所示:
git config remote.origin.fetch+ refs / heads / *:refs / remotes / origin / *
我真的很想知道为什么我的配置文件处于当前状态的潜在原因......也许我没有在正确的地方创建分支
一般来说,在创建新分支时,我正在做类似于
git checkout -b issue-1001
然后下面分享我的分支
git push origin issue-1001
er
, testing
, uat
和 release-1.9
。因此,任何推到远程仓库的其他分公司都会被忽略,并且永远不会被带到您当地的仓库。您的笔记本电脑上的refspec:
+ refs / heads / *:refs / remotes / origin / *
表示从远程存储库获取所有分支,所以任何新的分支都可以看到。 简单的说就是,如果你想看到新的分支,那么你需要使用一个像上面那样的refspec。 顺便说一句,你创建分支的方式看起来不错。 : - ) For some reason I can't see new branches that one my team has entered, I am 99% sure the branch exists as I can see it in Bitbucket's UI. I have a feeling it may be because my .git/config file is not correct. At the moment I have this... I have tried "git remote update" & "git fetch origin" but both fail to get the new branch I remember "starring" the issue here I can't see my remote branch, and changing my config to something like the following on an older laptop I would really like to know the underlying reason as to why my config file is in it's current state...perhaps I am not creating branches in the correct way? In general when creating new branches I am doing something like And then the following to share my branch
The says to fetch all branches from the remote repository, so any new branches would be visible to you. The short form is that if you want to see the new branches, then you need to use a refspec like the one above. BTW, the way you're creating branches looks fine. :-) 这篇关于无法看到远程分支,与.git / config的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
[remote "origin"]
url = git@bitbucket.org:user/project.git
fetch = +refs/heads/master:refs/remotes/origin/master
fetch = +refs/heads/testing:refs/remotes/origin/testing
fetch = +refs/heads/uat:refs/remotes/origin/uat
fetch = +refs/heads/release-1.9:refs/remotes/origin/release-1.9
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git checkout -b issue-1001
git push origin issue-1001
fetch
refspec you have in place is only fetching master
, testing
, uat
, and release-1.9
. As a result, any other branches pushed up to the remote repo, are ignored and are never brought to your local repo. The refspec on your laptop:+refs/heads/*:refs/remotes/origin/*