<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on Wimi's Space</title><link>https://wimi.space/tags/git/</link><description>Recent content in Git on Wimi's Space</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 19 Mar 2021 13:05:59 +0800</lastBuildDate><atom:link href="https://wimi.space/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Git 常用操作和提交规范</title><link>https://wimi.space/posts/2021/03/git-common-commands/</link><pubDate>Fri, 19 Mar 2021 13:05:59 +0800</pubDate><guid>https://wimi.space/posts/2021/03/git-common-commands/</guid><description>&lt;h2 id="git-提交规范">Git 提交规范&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>prefix&lt;/th>
 &lt;th>description&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>feat&lt;/td>
 &lt;td>A new feature&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>fix&lt;/td>
 &lt;td>A bug fix&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>docs&lt;/td>
 &lt;td>Documentation only changes&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>style&lt;/td>
 &lt;td>Changes that do not affect the meaning of the code&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>refactor&lt;/td>
 &lt;td>A code change that neither fixes a bug nor adds a feature&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>perf&lt;/td>
 &lt;td>A code change that improves performance&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>test&lt;/td>
 &lt;td>Adding missing tests or correcting existing tests&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>build&lt;/td>
 &lt;td>Changes that affect the build system or external dependencies&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>ci&lt;/td>
 &lt;td>Changes to our CI configuration files and scripts&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>chore&lt;/td>
 &lt;td>Other changes that don&amp;rsquo;t modify src or test files&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>revert&lt;/td>
 &lt;td>Reverts a previous commit&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="git-常用操作记录">Git 常用操作记录&lt;/h2>
&lt;h3 id="创建远端分支">创建远端分支&lt;/h3>
&lt;pre>&lt;code class="language-git"> git push --set-upstream origin &amp;lt;branch-name&amp;gt;
&lt;/code>&lt;/pre>
&lt;h3 id="删除远端分支">删除远端分支&lt;/h3>
&lt;pre>&lt;code class="language-git">git push origin :&amp;lt;branch-name&amp;gt;
# 或者
git push origin --delete &amp;lt;branch-name&amp;gt;
&lt;/code>&lt;/pre>
&lt;h3 id="从远程分支中创建并切换到本地分支">从远程分支中创建并切换到本地分支&lt;/h3>
&lt;pre>&lt;code class="language-git">git checkout -b &amp;lt;branch-name&amp;gt; origin/&amp;lt;branch-name&amp;gt;
&lt;/code>&lt;/pre>
&lt;h3 id="删除分支">删除分支&lt;/h3>
&lt;pre>&lt;code class="language-git">git branch -D &amp;lt;branch-name&amp;gt;
&lt;/code>&lt;/pre>
&lt;h3 id="重命名本地分支">重命名本地分支&lt;/h3>
&lt;pre>&lt;code class="language-git">git branch -m &amp;lt;new-branch-name&amp;gt;
&lt;/code>&lt;/pre>
&lt;h3 id="交互式变基到指定记录">交互式变基到指定记录&lt;/h3>
&lt;p>压缩commit记录&lt;/p></description></item></channel></rss>