🔧 基础操作
git init
git clone <repo_url>
git status
git add .
git commit -m "提交说明"
git log --oneline
git diff
🌿 分支管理
git branch <branch_name>
git checkout <branch_name>
git checkout -b <new_branch>
git merge <branch_name>
git branch -d <branch_name>
git branch -D <branch_name>
git branch -a
🚀 远程仓库操作
git remote add <remote_name> <repo_url>
git push -u <remote_name> <branch_name>
git push -f
git pull <remote_name> <branch_name>
git fetch
git push <remote_name> --delete <branch_name>
⏪ 撤销操作
git checkout -- <file>
git reset HEAD <file>
git commit --amend
git reset --soft <commit_id>
git reset --hard <commit_id>
git checkout <commit_id> -- <file_path>
🔍 日志与查询
git log --graph --all
git --author=
git -S
git blame <file>