SORU
2 AĞUSTOS 2011, Salı


Neden git içinde bir dosya unstage için 2 yol var mı?

Bazen git öneriyor git rm --cached Bir dosya unstage için, git reset HEAD file bazen. Ne zaman kullanmak gerekir?

DÜZENLEME:

D:\code\gt2>git init
Initialized empty Git repository in D:/code/gt2/.git/
D:\code\gt2>touch a

D:\code\gt2>git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       a
nothing added to commit but untracked files present (use "git add" to track)

D:\code\gt2>git add a

D:\code\gt2>git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file:   a
#
D:\code\gt2>git commit -m a
[master (root-commit) c271e05] a
 0 files changed, 0 insertions( ), 0 deletions(-)
 create mode 100644 a

D:\code\gt2>touch b

D:\code\gt2>git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       b
nothing added to commit but untracked files present (use "git add" to track)

D:\code\gt2>git add b

D:\code\gt2>git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   b
#

CEVAP
2 AĞUSTOS 2011, Salı


git rm --cached bir dosya unstage yok. Repo dosyasından çıkarılması aşamaları ve çalışma ağacında dosya, izlenmeyen bir dosya size bırakarak bırakır. Diğer yandan git reset, verilen herhangi bir dosya için değişiklikleri sahnelenen unstage.

Düzenleme:Eğer sahnelenecek olan yeni bir dosya git rm --cached kullanılan bir düşünce olsa da, daha önce işlenen olmuştu beri sadece unstaged varmış gibi temelde görünür. Belki de görmek istediğin şey bu muydu?

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Jorrit Jongma

    Jorrit Jongm

    17 Ocak 2008
  • Justin Davis

    Justin Davis

    14 Ocak 2008
  • The Onion

    The Onion

    14 Mart 2006