2. git: git diff, Remove files (git rm)

Pubblicato il: 01 gennaio 1970
sul canale di: Cường Mạnh
5
0

tự tóm tắt:
xem thay đổi của khu vực staged và unstaged
git diff:
git diff: hiển thị sự khác biệt giữa staged và trạng thái hiện tại của working directory (phần đang mở cmd) chứ không phải working tree (tất cả mã nguồn nơi .git tồn tại))
định nghĩa working tree và working directtory: the working tree, meaning the location where your repository has been checked out, and the working directory where you are running the git status command, which may be somewhere beneath your working tree (or perhaps not, if you set GIT_WORK_TREE environment variable).
git diff --cached (hoặc git diff --staged) sẽ hiển thị thay đổi giữa staged và lần commit trước đó gần nhất
git difftool để mở diff với 1 tool có sẵn
git commit:
dùng git commit --m"" thực hiện commit
dùng git commit -a -m"" để thực hiện add và commit các file tracked: nghĩa là sau khi add các file( staged các file) nhưng lại đi sửa thì để đỡ phải add lại (staged lại) thì dùng git commit -a -m cho nhanh
git commit sẽ mở lên editor và có 1 dòng trống đầu là message, sau khi đóng file thì nội dung message khác rỗng thì sẽ thực hiện commit và nội dung commit là message. message rỗng thì abort (bỏ commit)
git rm:
rm: lệnh của os(hđh) để xóa 1 file (rm=del=Shift + Delete khác với Delete) xóa vĩnh viễn file khỏi ổ đĩa
rm có thể xóa file nhưng nếu file đó đã được staged thì vẫn có thể khôi phục bằng git restote
git rm: sẽ xóa file trong ổ đĩa và xóa luôn trong staged, không tracking được nữa (nếu 1 file đã staged mà dùng git rm thì nó sẽ có cái prevent mất data nên muốn thì phải force -f vào (git rm -f) và không khôi phục được luôn nếu file đó chưa từng được commit
git rm --cached (dùng với tên file hoặc glob pattern) sẽ dùng để loại bỏ file khỏi staged area (hữu dụng khi thêm nhầm các file tmp vào staged) nhưng không xóa file mà chỉ untracked các file đấy
Note the backslash (\) in front of the *. This is necessary because Git does its own filename
expansion in addition to your shell’s filename expansion. This command removes all files that have
the .log extension in the log/ directory. Or, you can do something like this


In questa pagina del sito puoi guardare il video online 2. git: git diff, Remove files (git rm) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Cường Mạnh 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 5 volte e gli è piaciuto 0 spettatori. Buona visione!