Bazen git git rm --cachedbazen bir dosyayı bozmayı önerir git reset HEAD file. Hangisini ne zaman kullanmalıyım?
DÜZENLE:
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
#
rmgeri almak mantıklı değil addmi? Sizce nasıl rmdavranmalı?
git inithiçbir orada HEADsıfırlamak için.
rmunix bağlamında silme anlamına gelir. Dizine eklemenin tersi değildir. Dosyaları kaldırma işlevi, hazırlama durumunu değiştirme işlevleriyle aşırı yüklenmemelidir. Bunları birleştirmeyi kolaylaştıran uygulama detayları varsa, git'te düşünülebilir bir soyutlama katmanının bulunmamasına işaret eder, bu da kullanılabilirliği açık hale getirir.
git rmedebileceğimiz sahne bir silme de ve unstage bir ek )