İşleme git içinde yeniden adlandırır dosya
renaming files in git değişiklikleri kaydetme, yeniden adlandırma yapmak ve sonra yeniden adlandırılan dosya evre gerektiğini okumuştum. Git yeni izlenmeyen bir dosya olarak görmekten ziyade içeriğinden dosyasını tanımak, ve değişiklik geçmişini tutar.
Ancak, bu gece bunu yapıyorum git mv
dönüştürme sona erdi.
> $ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
#
mobile.css
iphone.css
Bulucu benim stil yeniden adlandırın
> $ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: css/iphone.css
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# css/mobile.css
O yüzden git şimdi bir CSS dosyası silinmiş olduğumu düşünüyor, ve bir yenisini daha ekledi. Ne istiyorum, yeniden adlandırma Geri Al ve git hadi iş yapalım.
> $ git reset HEAD .
Unstaged changes after reset:
M css/iphone.css
M index.html
Başladığım yere geri.
> $ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
#
Kullanım sağlar git mv
yerine.
> $ git mv css/iphone.css css/mobile.css
> $ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# renamed: css/iphone.css -> css/mobile.css
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: index.html
#
Görünüşe göre iyi. Neden git Bulucu kullandım ilk kez etrafında yeniden tanımadı?
CEVAP
git mv
için
manual page
diyor
Dizin başarıyla tamamlanmasından sonra,güncellenir [....]
Bu yüzden, ilk önce kendi dizini güncelleştirmek için
(git add mobile.css
kullanarak). Ancak
git status
yine de iki farklı dosyaları göster
$ git status
# On branch master
warning: LF will be replaced by CRLF in index.html
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
# new file: mobile.css
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: iphone.css
#
Çalıştırarak farklı bir çıkış alabilirsiniz
Sen ne sonuçlar git commit --dry-run -a
bekliyoruz
Tanascius@H181 /d/temp/blo (master)
$ git commit --dry-run -a
# On branch master
warning: LF will be replaced by CRLF in index.html
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
# renamed: iphone.css -> mobile.css
#
Bu farklılıklar görüyoruz tam olarak anlatamam
git status
arasında
* *23, ama
buradan bir ipucu.
Linus
git gerçekten bile yokbakımbütün hakkında "yeniden algılama" içten ve birini yapması bitti adlandırır tamamen bağımsız olan, biz daha sonra kullanmak sezgiselgösteryeniden adlandırır.
dry-run
bir süre gerçek yeniden adlandırma mekanizmaları kullanır
git status
muhtemelen gelmez.
GLSurfaceView parçası içinde yeniden i...
İşleme yeniden adlandırır: svn, git vs...
Nasıl bir proje içinde tek bir dosya i...
Takibi bırak ve Git içinde bir dosya i...
Neden git içinde bir dosya unstage içi...