Nasıl bir şube sadece bir dosya almak için
Git kullanmaya ve ana dal üzerinde çalışıyorum. Bu şube bir dosya app.js
çağırdı.
İçinde bir çok değişiklik ve iptalleri ton yaptım experiment
bir şube var. Şimdi master
şube tüm değişiklikler yalnızca experiment
app.js
yapılması getirmek istiyorum.
Nasıl yapabilirim?
Yine bir birleştirme istemiyorum. Ben sadece master
şube experiment
şube app.js
tüm değişiklikleri getirmek istiyorum.
CEVAP
git checkout master # first get back to master
git checkout experiment -- app.js # then copy the version of app.js
# from branch "experiment"
Ayrıca git how to undo changes of one file? bkz
Jakub Narębski yorum bahseder gibi:
git show experiment:path/to/app.js > app.js
çok, ÇOK ayrıntılı olarak" tam yolunu kullanmanız gerekir, repo. kök dizini formu "How to retrieve a single file from specific revision in Git? soru dışında çalışır
Dolayısıyla path/to/app.js onun örnekte Jacob tarafından kullanılır.
Frosty yorum bahseder gibi:
sadece app.js en son durumunu alacak
Ama, git checkout
ya aslında istediğiniz herhangi bir revizyon başvurusu yapabilirsiniz, BÖYLECE söz konusu gösterildiği gibi git show
"git checkout revision of a file in git gui":
$ git show $REVISION:$FILENAME
$ git checkout $REVISION -- $FILENAME
aynı olacaktır bir $FİLENAMEtam yolusürüm bilgisi dosyası.
$REVISION
git rev-parse
gibi gösterilebilir:
experiment@{yesterday}:app.js # app.js as it was yesterday
experiment^:app.js # app.js on the first commit parent
experiment@{2}:app.js # app.js two commits ago
ve benzeri.
Nasıl sadece `linux`dosya almak için?...
Nasıl Gıt mevcut şube adı almak için?...
Nasıl Gıt belirli revizyon tek bir dos...
Nasıl grep sadece dosya adları (in-lin...
Nasıl bir dosya adı kullanarak uygun b...