2013-03-25 12 views
6

の詳細な説明正直(<a href="https://www.kernel.org/pub/software/scm/git/docs/git-remote.html" rel="nofollow">man page</a>に確かではない)<code>git remote show</code>の出力のいずれかの詳細なドキュメントを見つけることができません「gitのリモートショー」

特に、Localセクションの明確な、正確な説明は、理解されるであろう。

私は混乱を見つけるものの例:

ここで私は2つのリモコン、KLAS起源、彼らが作り出す出力があります。

> git remote show klas 
* remote klas 
    Fetch URL: ..\klasrepo 
    Push URL: ..\klasrepo 
    HEAD branch: master 
    Remote branches: 
    experiment tracked 
    feature  tracked 
    master  tracked 
    pu   tracked 
    stashbranch tracked 
    Local branch configured for 'git pull': 
    pu merges with remote pu 
    Local refs configured for 'git push': 
    experiment pushes to experiment (fast-forwardable) 
    feature pushes to feature (fast-forwardable) 
    master  pushes to master  (fast-forwardable) 
    pu   pushes to pu   (up to date) 
> git remote show origin 
* remote origin 
    Fetch URL: C:/Temp/git/.\barerepo.git 
    Push URL: C:/Temp/git/.\barerepo.git 
    HEAD branch: experiment 
    Remote branches: 
    experiment tracked 
    master  tracked 
    Local branches configured for 'git pull': 
    experiment merges with remote experiment 
    master  rebases onto remote master 
    Local refs configured for 'git push': 
    experiment pushes to experiment (up to date) 
    master  pushes to master  (fast-forwardable) 

お知らせ実験マスターそのは、の両方ともlocal refs configured for 'git push'の下にリストされています。どういう意味ですか?私は(KLAS/PUを追跡するために、PUと原点/マスター及び原点/それぞれ実験を追跡するマスタ実験を構成しています。

私の地元機能分岐が何かを追跡するように設定されていないが、それでもlocal refs configured for 'git push'の下に表示されます(唯一の接続は、同じ名前のようです、別の非追跡ブランチ、FOOは、言及されていません)。 git pushフィーチャーにはfatal: The current branch feature has no upstream branch.がほとんど「早送り」できません。

local refs configured for 'git push'の下にリストされているローカルブランチの基準は、同じ名前のリモートブランチが存在しているようです。参考のため

> git branch -vva 
    experiment    0cf7b2a [origin/experiment] added rand content 82 to .\rand_content.txt 
* feature     4b25f46 added rand content 62 to bar.txt 
    foo      40aee50 added rand content 17 to .\rand_content.txt 
    master     4b25f46 [origin/master] added rand content 62 to bar.txt 
    pu      44ad10b [klas/pu] added rand content 51 to doo.txt 
    remotes/klas/experiment 1f4e89b app 
    remotes/klas/feature  884e953 added rand content 80 to bar.txt 
    remotes/klas/master  57877c1 added in tobias repo 
    remotes/klas/pu   44ad10b added rand content 51 to doo.txt 
    remotes/klas/stashbranch 8678cf0 added rand content 44 to .\rand_content.txt 
    remotes/origin/HEAD  -> origin/master 
    remotes/origin/experiment 0cf7b2a added rand content 82 to .\rand_content.txt 
    remotes/origin/master  4b25f46 added rand content 62 to bar.txt 
> git config --list --local | select-string 'branch|remote' 
remote.origin.url=C:/Temp/git/.\barerepo.git 
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* 
branch.master.remote=origin 
branch.master.merge=refs/heads/master 
branch.master.rebase=true 
remote.klas.url=..\klasrepo 
remote.klas.fetch=+refs/heads/*:refs/remotes/klas/* 
branch.experiment.remote=origin 
branch.experiment.merge=refs/heads/experiment 
branch.pu.remote=klas 
branch.pu.merge=refs/heads/pu 
> git --version 
git version 1.8.1.msysgit.1 

答えて

4

これはGitの1.8.1のバグのように見えます。次のようにGitのソースコード(具体的remote.cbuiltin/remote.c)をスキミング

は、 " 'Gitのプッシュ' のために設定ローカル参考文献" のリストを計算する:

  • 読み出し:

    1. が設定プッシュrefspecsを収集します.git/remotes/<remotename>(廃止された設定ファイル; git help repository-layoutを参照)
    2. は(別の時代遅れの設定ファイルを).git/branches/<branchname>を読ん
    3. はを調べます設定項目ステップ#1は、何かを見つける収集プッシュrefspecs一致すべて{ローカル、リモート}分岐の組み合わせを見つける
    4. refspecのみプッシュとして:を使用しなかった場合
  • 上記のアルゴリズムは、branch.<branchname>.remote,branch.<branchname>.merge、またはpush.defaultには注意しないことに注意してください。

    典型的な使用パターンの下では、上記のアルゴリズムのステップ1で設定されたrefspecが検出されず、:が使用されます。そのrefspecは単純な一致refspecなので、ローカルのリポジトリとリモートリポジトリの両方に<branchname>というブランチがある場合、通常の使用でgit remote show <remotename>は常に<branchname> pushes to <branchname>を出力します。

    関連する問題