git常用指令
<p><img src="https://images2018.cnblogs.com/blog/1107536/201808/1107536-20180809204607665-951328966.png" alt="" /></p>
<pre><code>git clone xxxxxxx //克隆默认分支(master)代码到本地
git clone -b 分支名 xxxxxx //克隆指定分支代码到本地
git status //查看本地当前分支代码状态
git add . // 添加所有变动到临时追踪库
git commit -m "备注" //提交临时库代码到本地库
git reset //撤销commit
git reset HEAD~ //撤销commit 到 add 之前
git reset -hard xxxxxxx //回滚到指定commit
git pull // 拉取远程库最新代码
git push // 推送当前分支本地库代码到远程库
git branch //显示本地当前分支
git checkout xxx //切换到指定分支
git checkout * // 放弃所有修改
git merge xxxxx //合并指定分支
https://www.cnblogs.com/hanguidong/p/10740242.html</code></pre>
<h2>git 查看所有远程分支以及同步</h2>
<pre><code>1、查看所有远程分支:git fetch --all
2、拉取远程分支并同时创建对应的本地分支:git checkout -b 本地分支名 origin/远程分支名</code></pre>