Git bas hata '[uzaktan reddetti] ana -> master (şube şu anda kullanıma)' | Netgez.com
SORU
12 Mayıs 2010, ÇARŞAMBA


Git bas hata '[uzaktan reddetti] ana -> master (şube şu anda kullanıma)'

Dün, başka makinelerin birinden Git bir depo klon, nasıl bir soru yayınlanmıştırHow can I 'git clone' from another machine?.

Şimdi başarılı bir şekilde gidilecek yere kaynağım (192.168.1.2) Git deposu (192.168.1.1) klonlamak mümkün duyuyorum.

Ama bir dosya için düzenleme yaptım a git commit -a -m "test" ** 3, benim hedef (192.168.1.1) bu hatayı alıyorum:

git push                                                
hap@192.168.1.2's password: 
Counting objects: 21, done.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1010 bytes, done.
Total 11 (delta 9), reused 0 (delta 0)
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
error: is denied, because it will make the index and work tree inconsistent
error: with what you pushed, and will require 'git reset --hard' to match
error: the work tree to HEAD.
error: 
error: You can set 'receive.denyCurrentBranch' configuration variable to
error: 'ignore' or 'warn' in the remote repository to allow pushing into
error: its current branch; however, this is not recommended unless you
error: arranged to update its work tree to match what you pushed in some
error: other way.
error: 
error: To squelch this message and still keep the default behaviour, set
error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To git ssh://hap@192.168.1.2/media/LINUXDATA/working
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git ssh://hap@192.168.1.2/media/LINUXDATA/working'

Git (yerel makinede uzaktan 1.7 ve 1.5) iki farklı versiyonu kullanıyorum. Olası bir sebep var mı?

CEVAP
14 Temmuz 2010, ÇARŞAMBA


Sadece çıplak havuz (çıplak depodaki çalışma kopyası yok - klasörü tek gerçek depo veri içeren) uzaktan depo dönüştürebilirsiniz.

Uzaktan depo klasöründe aşağıdaki komutu yürütün

git config --bool core.bare true

Sonra o klasördeki .git hariç tüm Dosyaları Sil. Ve sonra herhangi bir hata olmadan uzaktan havuzu git push gerçekleştirmek mümkün olacak.

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VÄ°DEO

Rastgele Yazarlar

  • Electro Posé

    Electro PosÃ

    21 ÅžUBAT 2013
  • mliskIT

    mliskIT

    29 Mart 2012
  • spectragirlz16's channel

    spectragirlz

    22 Ocak 2012