- git config --global user.name "cat",git config --global user.email "123456@qq.com":设置用户信息
- git config --list:查看配置信息
- git init:在本地初始化一个Git仓库
- git clone [url]:从远程仓库克隆
- git status:查看文件修改状态
- git add [文件名]:将文件的修改加入暂存区
- git reset [文件名]:将暂存区的文件取消暂存,或者切换到指定版本git reset --hard [版本号]
- git commit -m "描述信息" [文件名]:将暂存区的文件修改提交到版本库
- git log:查看日志
- git remote:查看远程仓库
- git remote add [shortname] [url]:添加远程仓库
- git clone [url]:从远程仓库克隆
- git pull [shortname] [branchname]:从远程仓库拉取
- git push [shortname] [branchname]:推送到远程仓库
- git branch:查看分支
- git branch [branchname]:创建分支
- git checkout [branchname]:切换分支
- git checkout -b 恢复的分支名称: 恢复的分支名称
- git push [shortname] [branchname]:推送至远程仓库分支
- git merge [branchname]:合并分支
- git tag:列出已有的标签
- git tag [tagname]:创建标签
- git push [shortname] [tagname]:将标签推送至仓库
- git checkout -b [branchname] [tagname]:检出标签