1.5 KiB
1.5 KiB
1. Git Commands
Command:
- git checkout -b branch # Tạo nhánh.
- git pull origin branch # Kéo repo từ nhánh
- git add . | git add filename# Thêm file vào staging
- git commit -m "feat: content" # Commit thay đổi theo format scope + nội dung
- git push origin branch # Đẩy repo lên source code
- git merge branch # gộp tính năng vào
- git branch -d ten-nhanh # xóa local
- git push origin --delete ten-nhanh # xóa remote
Commit Scope
- Dev Code →
feat,fix - **Dev Refactor →
refactor,perf,style - DevOps →
build,ci,chore - Tester|BA →
docs,test - Leader | Automation →
revert
2. Docker Commands
Command:
- docker build -t image:tag : tạo docker image từ Dockerfile
- docker build --cache-from image:tag -t image:tag : Cache
- docker run --rm -it image:tag sh : Chạy container
- docker exec -it image:tag bash: Thực hiện lệnh trong Container
- docker compose down: tắt các docker đang chạy
- docker compose up -d : chạy lại các docker (background)
- docker ps -a: Xem danh sách docker đã khởi chạy
- docker container|image|volume prune -f : Xóa các entity không dùng
- docker network inspect network:name : Xem chi tiết network
3. Config Init
- git config --global commit.template ~/.gitmessage.txt : Gắn Template commit template
- git config --global user.name "Tên của bạn"
- git config --global user.email "email@example.com"