3

.git / config 1

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = ssh://johndoe@example.com//repositories/plugins/myproject.git
[branch "master"]
    remote = origin
    merge = refs/heads/master

.git / config 2

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = ssh://johndoe@example.com//repositories/plugins/myproject.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "develop"]
    remote = origin
    merge = refs/heads/develop]

ただし、両方のリポジトリで、入力するbranch -aと、両方が返されます

git branch -a
* develop
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
4

2 に答える 2

3

develop最初のリポジトリには、リモートリポジトリのブランチを追跡するブランチがありません。

違いを確認するには、git branch -avv各リポジトリで実行します。これにより、すべてのブランチ(ローカルおよびリモート)、それぞれがオンになっているコミット、および各ローカルブランチによって追跡されているリモートブランチ(存在する場合)が表示されます。

于 2013-01-26T20:21:01.077 に答える
3

[branch "develop"]using を定義していないリポジトリの開発ブランチからプルしようとするとgit pull、リモート ブランチを指定していないというエラーが表示されます。git branch --set-upstream develop origin/developGit は、そのエントリを作成し、リモート ブランチを適切に追跡するために実行することを提案します。

于 2013-01-26T07:18:12.843 に答える