SORU
11 EKİM 2009, Pazar


İtmek için olası bir gıt uzak bir depoya saklamak mı?

Git, oluşturmak için olası bir zula, uzak bir depoya saklamak, başka bir bilgisayarda saklamak almak ve uygulamak bas malı?

Ya benim seçenekler:

  • Bir yama oluşturmak ve diğer bilgisayara yama kopyalama veya
  • Küçük bir şube oluşturmak ve bu şube için eksik işleri tamamlama?

CEVAP
9 Mart 2011, ÇARŞAMBA


Not:Sadece 24 saat git-fu benim kemer altında daha fazla bu cevabı tekrar yazdım :) Kabuk geçmişim, hepsi şimdi üç tek gömlekleri. Ancak, size kolaylık sağlamak için onları yoğuşmamış ettim.

Bu şekilde, şeyler, sadece körü körüne/yapıştır şeyleri kopyalamak yerine nasıl yaptığımı görmek mümkün olacağını umuyoruz.


İşte adım adım.

OLDREPO içeren düzenleme ~/kaynağı olduğunu varsayalım. Hiçbir düzenleme içeren: TEST bir klon oluşturun

cd ~/OLDREPO
git clone . /tmp/TEST

Şube olarak temp: tüm ayarları geri itin

git send-pack /tmp/TEST $(for sha in $(git rev-list -g stash); \
    do echo $sha:refs/heads/stash_$sha; done)

Düzenleme: geri dönüşüm için alıcı son döngü

cd /tmp/TEST/
for a in $(git rev-list --no-walk --glob='refs/heads/stash_*'); 
do 
    git checkout $a && 
    git reset HEAD^ && 
    git stash save "$(git log --format='%s' -1 HEAD@{1})"
done

Eğer isterseniz geçici dalları temizleme

git branch -D $(git branch|cut -c3-|grep ^stash_)

Listeyi saklamak gibi bir şey olacak, bu sadece bir git yap:

stash@{0}: On (no branch): On testing: openmp import
stash@{1}: On (no branch): On testing: zfsrc
stash@{2}: On (no branch): WIP on sehe: 7006283 fixed wrong path to binary in debianized init script (reported as part of issue
stash@{3}: On (no branch): WIP on debian-collab: c5c8037 zfs_pool_alert should be installed by default
stash@{4}: On (no branch): WIP on xattrs: 3972694 removed braindead leftover -O0 flag
stash@{5}: On (no branch): WIP on testing: 3972694 removed braindead leftover -O0 flag
stash@{6}: On (no branch): WIP on testing: db9f77e fuse_unmount_all could be starved for the mtx lock
stash@{7}: On (no branch): WIP on xattrs: db9f77e fuse_unmount_all could be starved for the mtx lock
stash@{8}: On (no branch): WIP on testing: 28716d4 fixed implicit declaration of stat64
stash@{9}: On (no branch): WIP on emmanuel: bee6660 avoid unrelated changes

Orijinal depo, aynı gibi görünüyordu

stash@{0}: WIP on emmanuel: bee6660 avoid unrelated changes
stash@{1}: WIP on testing: 28716d4 fixed implicit declaration of stat64
stash@{2}: WIP on xattrs: db9f77e fuse_unmount_all could be starved for the mtx lock
stash@{3}: WIP on testing: db9f77e fuse_unmount_all could be starved for the mtx lock
stash@{4}: WIP on testing: 3972694 removed braindead leftover -O0 flag
stash@{5}: WIP on xattrs: 3972694 removed braindead leftover -O0 flag
stash@{6}: WIP on debian-collab: c5c8037 zfs_pool_alert should be installed by default
stash@{7}: WIP on sehe: 7006283 fixed wrong path to binary in debianized init script (reported as part of issue #57)
stash@{8}: On testing: zfsrc
stash@{9}: On testing: openmp import

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Hak5

    Hak5

    7 EYLÜL 2005
  • schmittastic

    schmittastic

    9 EYLÜL 2009
  • Smith Micro Graphics

    Smith Micro

    15 Mayıs 2008