2015-08-20 17 views
5

Według Git notach 2.5.0 uwalnianiu:Czym różni się @ {push} od @ {u} lub oddziału śledzenia?

Nowa krótkim ręka <branch>@{push} oznacza zdalnego śledzenia oddział, który śledzi gałąź na pilocie zostanie wciśnięty do.

Czym się to różni od <branch>@{u} (dla branży upstream), lub nawet po prostu robi $ git push bez parametrów, gdy właściwy oddział śledzenia jest ustawiony?

Odpowiedz

2

Oto odpowiednią dokumentację, z git help rev-parse:

 <branchname>@{push}, e.g. [email protected]{push}, @{push} 
     The suffix @{push} reports the branch "where we would push to" if 
     git push were run while branchname was checked out (or the current 
     HEAD if no branchname is specified). Since our push destination is 
     in a remote repository, of course, we report the local tracking 
     branch that corresponds to that branch (i.e., something in 
     refs/remotes/). 

     Here's an example to make it more clear: 

      $ git config push.default current 
      $ git config remote.pushdefault myfork 
      $ git checkout -b mybranch origin/master 

      $ git rev-parse --symbolic-full-name @{upstream} 
      refs/remotes/origin/master 

      $ git rev-parse --symbolic-full-name @{push} 
      refs/remotes/myfork/mybranch 

     Note in the example that we set up a triangular workflow, where we 
     pull from one location and push to another. In a non-triangular 
     workflow, @{push} is the same as @{upstream}, and there is no need 
     for it. 

Tak, będą się różnić, jeśli przed śledzenia oddział znajduje się w innej niż jednego pilota już skonfigurowany do push domyślnie.

Powiązane problemy