GIT Cheatsheet

Cập nhật ngày 10/05/2026
Lượt xem: 426

Các lệnh GIT hữu ích đối với tôi?

Cấu hình trước khi dùng

git config --global user.name "John Doe"
git config --global user.email "[email protected]"

Xóa Cache

git rm -r -f --cached .

Clone Repo

git clone --depth 1 [repo]

Push từ Repo có sẵn

git add .
# git add [file]

git commit -m "update"

git push
# git push origin [branch]

So sánh thay đổi

git diff -w

Auto token

git config credential.helper store

Reflog Reset

git reflog expire --expire=now --all
git gc --prune=now