git 常用 操作

git提交代码流程
git status -- 查看当前仓库状态
git add  -- 添加到临时仓库
git commit -m '注释'  -- 添加到临时仓库
git status -- 查看当前仓库状态
git pull origin master -- 更新远程仓库代码
git push origin  origin --提交到远程仓库
备注:origin(远程仓库名) origin(远程仓库名)

git merge  冲突提示
git branch  -- 查看分支
git status  --查看状态
git diff  -- 查看差异修改内容
git log  -- 查看版本记录

分支提交
git checkout dev  -- 切换分支
git merge dev --合并
git remote add origin *****  -- 连接远程仓库
git init -- 本地仓库

--------------------------
有时候提交代码的时候会进入 VIM(可编辑)模式(可编辑)
退出VIM步骤:1. 按ESC
         2. 按 shift + :(冒号)
         3. Q+! (退出不保存)
        Q+w (退出并保存)
还有一种方法可以退出VIM 模式:按ESC,然后按大写ZZ 退出

原文地址:https://www.cnblogs.com/Kyaya/p/11040912.html