Set config
git config --global user.name "Name"
git config --global user.email "Email"Get config
git config --global user.name
git config --global user.emailgit initgit remote add origin git_url
git remote -vgit clone git_urlgit pull origin mastergit push origin masterCheck status
git statusTo add a file to staging area
git add FILE_NAMETo remove a file from staging area
git rm --cached FILE_NAMETo add all file to staging area
git add .To show all the commits with detail
git logTo show all(n) the commits in one line
git log --oneline
git log --oneline -n
To commit
git commit -m "comment"#. Đang code dở file main.cpp
#. Cần chuyển sang nhánh khác để sửa bug gấpLưu vào stash
git stash save -m "comment"Lấy ra toàn bộ stash
git stash listKhôi phục stash gần nhất và xóa khỏi danh sách
git stash popKhôi phục stash gần nhất nhưng không xóa khỏi danh sách
git stash applyXóa một stash
git stash drop stash@{0}Xóa mọi stash
Xóa tất cả stash
Ex:
.env
/Folder
*.txt