2013-03-25 15 views
6

Szczerze nie mogę znaleźć żadnej szczegółowej dokumentacji wyjściu git remote show (na pewno nie na man page)Szczegółowe wyjaśnienie „git zdalnego show”

W szczególności, wyraźne, dokładne wyjaśnienie Local sekcjach będą mile widziane.

Przykładem tego, co znajdę mylące:

Tutaj mam dwa piloty, Klas i pochodzenia a wyjście produkują:

> 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) 

Uwaga, eksperyment i mistrz są wymienione pod zarówno . Co to znaczy? I skonfigurowany pana i eksperyment śledzić pochodzenia/master i Pochodzenie/eksperyment odpowiednio (a PU śledzić KLAS/PU).

Mój lokalny cecha oddział nie jest ustawiony, aby śledzić wszystko, ale nadal jest na liście pod local refs configured for 'git push' (jedyne połączenie wydaje się być identyczna nazwa, inna niż śledzenie gałąź, foo, nie wspomniano). git push podczas gdy na cecha daje fatal: The current branch feature has no upstream branch. - prawie "fast-forwardable".

Wydaje się, że kryteria dla lokalnego oddziału pod numerem local refs configured for 'git push' są takie, że istnieje zdalny oddział o tej samej nazwie?

Dla porównania:

> 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 

Odpowiedz

4

Wydaje się to być błąd w Git 1.8.1.

Przeglądając kod Git źródłowy (konkretnie remote.c i builtin/remote.c), listę pod "Lokalnych odn skonfigurowanych dla 'git push'" oblicza się w następujący sposób:

  1. zbierać skonfigurowane refspecs przycisku:
    • odczytu .git/remotes/<remotename> (przestarzały plik konfiguracyjny; patrz git help repository-layout)
    • czytać .git/branches/<branchname> (inny przestarzały plik config)
    • zbadać remote.<remotename>.push config poz
  2. jeśli krok nr 1 nie znaleźliśmy niczego, użyj : jako jedyny naciśnięciem refspec
  3. znaleźć wszystkie {} lokalne, zdalne połączenia oddziałów, które dopasowane zebrane refspecs Push

Zauważ, że powyższy algorytm nie zwraca uwagi na branch.<branchname>.remote, branch.<branchname>.merge lub push.default.

W typowych schematach użytkowania, krok nr 1 w powyższym algorytmie nigdy nie znajdzie żadnego skonfigurowanego refspecs, więc zostanie użyty :. To refspec jest prostym pasującym refspec, więc przy typowym użyciuzawsze będzie drukować <branchname> pushes to <branchname>, jeśli w obu repozytoriach lokalnych i zdalnych jest gałąź o nazwie <branchname>.

Powiązane problemy