git本地常用命令 git status-----查看文件状态 git add–将文件的修改加入暂存区 git reset–将暂存区的文件取消暂存或者是切换到指定版本 git commit–将暂存区的文件修改提交到版本库 git log–查看日志 git远程仓库常用命令 git remote–查看远程仓库 git remote add–添加远程仓库 git clone–从远程仓库克隆 git pull–从远程仓库拉取 git push–推送到远程仓库 git分支操作常用命令 git branch–查看分支 git branch [name]–创建分支 git checkout [name]–切换分支 git push [shortName] [name]–推送至远程仓库分支 git merge [name]–合并分支 远程新建分支后,本地查看不到,使用以下命令同步 git remote # 列出所有远程主机 git remote update origin --prune # 更新远程主机origin 整理分支 git branch -r # 列出远程分支 标签操作 git tag–列出已有的标签 git tag [name]–创建标签 git push [shortName] [name]—将标签推送至远程仓库 git checkout -b [branch][name]检出标签