git(v1.9.1)克隆不是自动跟踪分支
我几乎没有github存储库。克隆某个存储库时,会自动跟踪分支的后续签出。但其他回购协议很少有这种情况发生 我的git版本git(v1.9.1)克隆不是自动跟踪分支,git,github,tracking,git-clone,Git,Github,Tracking,Git Clone,我几乎没有github存储库。克隆某个存储库时,会自动跟踪分支的后续签出。但其他回购协议很少有这种情况发生 我的git版本 root@e7440:~/dev_env/wq$ git --version git version 1.9.1 自动跟踪git克隆 root@e7440:~/dev_env$ git clone git@github.com:XYZ/lb.git lb Cloning into 'lb'... remote: Counting objects: 6433, done.
root@e7440:~/dev_env/wq$ git --version
git version 1.9.1
自动跟踪git克隆
root@e7440:~/dev_env$ git clone git@github.com:XYZ/lb.git lb
Cloning into 'lb'...
remote: Counting objects: 6433, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6433 (delta 0), reused 0 (delta 0), pack-reused 6431
Receiving objects: 100% (6433/6433), 7.24 MiB | 10.79 MiB/s, done.
Resolving deltas: 100% (4636/4636), done.
Checking connectivity... done.
root@e7440:~/dev_env$ cd lb
签出开发分支
root@e7440:~/dev_env/lb$ git checkout develop
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
已签出的分支“开发”自动跟踪
root@e7440:~/dev_env/lb$ git branch
* develop
master
lb回购上的远程分支
root@e7440:~/dev_env/lb$ git branch -r
origin/HEAD -> origin/master
origin/develop
origin/master
origin/production
origin/stage
同一帐户中的另一个存储库在签出分支时不会自动跟踪
root@e7440:~/dev_env$ git clone --no-single-branch git@github.com:XYZ/wq.git wq
Cloning into 'wq'...
remote: Counting objects: 13552, done.
remote: Compressing objects: 100% (3397/3397), done.
remote: Total 13552 (delta 348), reused 0 (delta 0), pack-reused 10155
Receiving objects: 100% (13552/13552), 15.95 MiB | 10.83 MiB/s, done.
Resolving deltas: 100% (5481/5481), done.
Checking connectivity... done.
root@e7440:~/dev_env/lb$ cd wq
查看“wq”回购协议上的开发分行
root@e7440:~/dev_env/wq$ git checkout develop
root@e7440:~/dev_env/wq$ git branch
* master
“wq”存储库的所有远程分支
root@e7440:~/dev_env/wq$ git branch -r
origin/HEAD -> origin/master
origin/develop
origin/feature-gulpversion
origin/feature-lb-groups
origin/feature-maps
origin/feature-pic
origin/feature-redesign
origin/feature-timerz
origin/master
origin/production
origin/stage
我不知道为什么会这样。当本地分支名称与远程分支名称匹配时,如何确保自动跟踪远程分支
受影响回购协议的.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@github.com:XYZ/wq.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
git flow init命令的输出
$:~/dev_env$ git clone --no-single-branch git@github.com:XYZ/wq.git wq
Cloning into 'wq'...
remote: Counting objects: 13567, done.
remote: Compressing objects: 100% (3412/3412), done.
remote: Total 13567 (delta 353), reused 0 (delta 0), pack-reused 10155
Receiving objects: 100% (13567/13567), 16.05 MiB | 559.00 KiB/s, done.
Resolving deltas: 100% (5486/5486), done.
Checking connectivity... done.
$:~/dev_env$ cd wq
$:~/dev_env/wq$ git flow init -f
Which branch should be used for bringing forth production releases?
- master
Branch name for production releases: [master] production
Which branch should be used for integration of the "next release"?
- master
Branch name for "next release" development: [master] develop
Fatal: Local branch 'develop' does not exist.
它退出git流时出错
意识到一件事,这个分支是来自另一个分支的分支也许你可以查看.git目录,看看配置中是否有任何东西可以防止上述情况发生。看起来你的配置文件中有什么东西。你能粘贴它吗(关于给定分支的部分)@jsexpert我已经用受影响分支的.git/config文件更新了帖子,看起来你的配置很好。你能试着运行git flow init(如果需要添加-f)到新的克隆repo中,然后再次进行签出开发吗?我将安装git flow,但我不使用git flow,git flow是否会专门为这个分支做什么?更大的问题是,为什么它在另一个存储库中没有git flow init的情况下自动跟踪