<?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 Council of Elrond</title><link>https://songkou.github.io/tags/git/</link><description>Recent content in Git on Council of Elrond</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 25 Dec 2021 01:31:18 +0800</lastBuildDate><atom:link href="https://songkou.github.io/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Git_cheat_sheet</title><link>https://songkou.github.io/posts/git_cheat_sheet/</link><pubDate>Sat, 25 Dec 2021 01:31:18 +0800</pubDate><guid>https://songkou.github.io/posts/git_cheat_sheet/</guid><description>&lt;h2 id="git-cheat-sheet"&gt;Git cheat sheet&lt;/h2&gt;
&lt;h3 id="configure"&gt;Configure&lt;/h3&gt;
&lt;p&gt;Configure system/global level of current repository username, email&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git config --global user.name &amp;quot;Jerry Mouse&amp;quot; 
git config --global user.email &amp;quot;jerry@yiibai.com&amp;quot;`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;List git configs&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git config --list 
git config -l`
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id="initialize"&gt;initialize&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id="modify-commit"&gt;Modify commit&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;git add a.html 
git commit -m &amp;quot;提交文件a.html&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git revert&lt;/code&gt;- is about making a new commit that reverts the changes made by other commits.&lt;code&gt;git reset&lt;/code&gt; is about updating your branch, moving the tip in order to add or remove commits from the branch. This operation changes the commit history. it can also be used to restore the index, overlapping with git restore.&lt;code&gt;git-restore&lt;/code&gt; is about restoring files in the working tree from either the index or another commit. This command does not update your branch. The command can also be used to restore files in the index from another commit.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Revert will reverse the changes from a commitment and is used mostly to undo faulty commits. This means that you can revert specific commits without affecting others. Revert works by making a new commit with the changes removed. You can revert any past commit. This can be the last commit, &lt;code&gt;$ git revert HEAD&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>