git // 添加指定文件到暂存区$ git add [file1] [file2] …// 添加指定目录到暂存区,包括子目录$ git add [dir]// 添加当前目录的所有文件到暂存区$ git add .// 删除工作区文件,并且将这次删除放入暂存区$ git rm [file1] [file2] …// 停止追踪指定文件,但该文件会保留在工作区$ git rm –cached [file]// 改名文件,并且将这个改名放入暂存区$ git mv [file-original] [file-renamed]// 提交暂存区到仓库区$ git commit -m [message]// 提交暂存区的指定文件到仓库区$ git commit [file1] [file2] … -m [message]// 列出所有本地分支$ git branch// 列出所有远程分支$ git branch -r// 列出所有本地分支和远程分支$ git branch -a// 新建一个分支,但依然停留在当前分支$ git branch [branch-name]// 新建一个分支,并切换到该分支$ git checkout -b [branch]$ git push origin [branch] //第一次要先空 push // 切换到指定分支,并更新工作区$ git checkout [branch-name]// 切换到上一个分支$ git checkout -// 合并分支 git merge origin/branch-name// 删除本地分支$ git branch -d [branch-name]// 删除远程分支$ git branch -r -d origin/test$ git push origin -d test// 冲突合并 (待测试)$ git mergetool$ beyond compare// 显示有变更的文件$ git status// 显示当前分支的版本历史$ git log// 显示暂存区和工作区的代码差异$ git diff// 取回远程仓库的变化,并与本地分支合并$ git pull [remote] [branch]origin master// 上传本地指定分支到远程仓库$ git push [remote] [branch]origin master$ git init在工作目录中初始化新仓库要对现有的某个项目开始用 Git 管理,只需到此项目所在的目录。// 版本回退$ git reset –hard 版本号① git pull origin master② git add [dir]git add [file1] [file2] …git add .③git commit -m [str message]④git push origin master// git强制覆盖本地代码:$ git fetch –all$ git reset –hard origin/remoteresposity$ git pull// git强制覆盖本地命令(单条执行):$ git fetch –all && git reset –hard origin/develop && git pull// git强制推送本地代码到远程仓库 (待检验)$ git push -u origin develop; ng 启动 start nginx.exe重启 nginx.exe -s reload 【ng根目录 nginx-reload.bat】退出 nginx.exe -s quit