2013-07-22 16 views
10

benim config bu bölümde ile sona erdi nasıl (egit ile oluşturulan şube, muhtemelen) emin değilim:Ne demek remote =. GIT yapılandırmasında?

[branch "master"] 
    remote = origin 
    merge = refs/heads/master 
[branch "sfc"] 
    remote = . 
    merge = refs/heads/master 
    rebase = true 

Bunu anlamak istiyorum. remote = .'daki noktanın url (geçerli dizin) veya özel bir depo adı (kendime ait diğer ad) olarak yorumlanıp yorumlanmadığından emin değilim? Bu yasal/normal/tipik mi, yoksa bunun berbat olduğunu mu tahmin etmeliyim? Aynı depoya işaret eden "uzak" özelliklere sahip olmak bana garip geliyor. Dahası, bu şube uzaktan kumandada var ... İtme/çekme davranışıyla ilgili bunun ne gibi etkileri olurdu?

Biraz daha bilgi: oldukça garip

$ git remote show origin 
* remote origin 
    Fetch URL: ssh://[email protected]/var/gitrep/zzz.git 
    Push URL: ssh://[email protected]/var/gitrep/zzz.git 
    HEAD branch: master 
    Remote branches: 
    master tracked 
    sfc tracked 
    Local branch configured for 'git pull': 
    master merges with remote master 
    Local refs configured for 'git push': 
    master pushes to master (fast-forwardable) 
    sfc pushes to sfc (up to date) 

$ git branch -vv 
* master  f394d8b [origin/master: ahead 1] Bla blah... 
    sfc  8065309 [master: behind 89] Bla blah... 
+1

Sanırım mevcut deponuza başvuruyor ... bir taahhüt oluşturmaya çalış ve '' git get sch '' yap? –

cevap

4

. İleriye gittim ve bir manken repo oluşturdum, .git/config'u değiştirerek bir uzaktan kumandası ., bazı kodları ekledim, taahhüt ettim ve ittim.

$ git checkout weird 
$ touch nothing 
$ git add nothing 
$ git commit -a -m "test" 
[sup 031541e] test 
1 file changed, 0 insertions(+), 0 deletions(-) 
create mode 100644 nothing 
$ git push 
fatal: The upstream branch of your current branch does not match 
the name of your current branch. To push to the upstream branch 
on the remote, use 

    git push . HEAD:master 

To push to the branch of the same name on the remote, use 

git push . weird 

$ git push . weird 
Everything up-to-date 

Elbette GIT'inde bir itme sonuçlar, güncel söyleyerek, yani lokal olarak depoyu isabet gibi görünüyor.

2

Git, bunu ../../some/other/repo gibi göreli bir yol olarak çözecektir. Bu şekilde, deponun kendisinin dizinini çözecektir. Uzak birleştirme hedefiniz master olduğundan, git push koşuluyla sfc teslim edilirken, master'u sfc'a hızlı-ileri sarmayı deneyebilirsiniz.

Sen Belki de bu başlangıç ​​noktası olarak uzaktaki bir şube kurmayı unuttuğu çünkü, bunu yaptık

git branch --set-upstream somebranch 

çalıştırarak böyle dalları oluşturabilir.