You are on page 1of 2

1.

Tạo repository local


Git init
2. Tạo file trên máy tính(working)
3. Đưa file vào repository local
- Git add ten_file or git add . (add
tat ca ca file)
- Git commit -m “comment”. Sẽ đưa
file vào trong repository local
4. Xóa file trên git local (sau khi
commit)
- Git rm ten_file
- Xóa nhầm thì restore lại: git
restore –staged
5. Xóa file sau khi add (untracke)
- Git rm –cache ten_file
6. Bỏ qua thư muc, file không muốn
add, commit
- Tạo file .gitignore và đưa thư muc
hay file vào file .gitignore đấy với
cú pháp:
thu_muc/ (bỏ qua thư muc)
Ten_file.txt (bỏ qua file
ten_file.txt)
*.txt (bỏ qua tất cả các file .txt)

7. Tạo nhánh
- Git branch ten_nhanh
- Git branch -l xem nhánh
- Git checkout ten_nhanh ( chuyển
nhánh)
- Git branch -d ten_nhanh (xóa
nhánh)
- Git merge ten_nhanh (gộp nhánh)

You might also like