-
克隆仓库:
git clone <repository_url> -
添加文件到暂存区:
git add <file_name> -
提交到本地仓库:
git commit -m "Commit message" -
推送到远程仓库:
git push origin <branch_name> -
拉取远程仓库更新:
git pull origin <branch_name> -
查看当前文件状态:
git status -
查看提交日志:
git log -
创建新分支:
git branch <branch_name> -
切换分支:
git checkout <branch_name> -
合并分支:
git merge <branch_name> -
查看远程仓库信息:
git remote -v -
撤销工作区的修改:
git checkout -- <file_name> -
撤销暂存区的修改:
git reset HEAD <file_name>