<?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 Shaka</title><link>https://shakaxi.github.io/tags/git/</link><description>Recent content in Git on Shaka</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 01 Jul 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://shakaxi.github.io/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Git</title><link>https://shakaxi.github.io/posts/git/</link><pubDate>Sat, 01 Jul 2023 00:00:00 +0000</pubDate><guid>https://shakaxi.github.io/posts/git/</guid><description>&lt;div id="outline-container-headline-1" class="outline-2"&gt;&#10;&lt;h2 id="headline-1"&gt;&#10;Introduction&#10;&lt;/h2&gt;&#10;&lt;div id="outline-text-headline-1" class="outline-text-2"&gt;&#10;&lt;p&gt;&lt;em&gt;Git&lt;/em&gt; is a famous and powerful open-source software for version control and management. It was developed by Linus Torvalds with C programing language. What is different from &lt;em&gt;subversion&lt;/em&gt;, git adopts a completely distributed manner. Regarding its utilization, besides its built-in manual, there is also an excellent book, &lt;em&gt;Pro Git&lt;/em&gt;, which can be obtained for free&lt;sup class="footnote-reference"&gt;&lt;a id="footnote-reference-1" href="#footnote-1"&gt;1&lt;/a&gt;&lt;/sup&gt;. This post just summarizes the preliminary usage of git, which is referred from the book.&lt;/p&gt;&#10;&lt;div id="outline-container-headline-2" class="outline-3"&gt;&#10;&lt;h3 id="headline-2"&gt;&#10;Objects&#10;&lt;/h3&gt;&#10;&lt;div id="outline-text-headline-2" class="outline-text-3"&gt;&#10;&lt;p&gt;In git, there are 3 types of objects defined, &lt;em&gt;blob&lt;/em&gt;, &lt;em&gt;tree&lt;/em&gt;, and &lt;em&gt;commit&lt;/em&gt;. In order to view its properties, a dedicated command &lt;code class="verbatim"&gt;git cat-file&lt;/code&gt; is provided. Its type and content can be returned with option &lt;code class="verbatim"&gt;-t&lt;/code&gt; and &lt;code class="verbatim"&gt;-p&lt;/code&gt; respectively.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A blob keeps the content of a binary compressed file.&lt;/li&gt;&#10;&lt;li&gt;A tree represents a directory, including its hierarchy, permission, and the names of its componential files.&lt;/li&gt;&#10;&lt;li&gt;A commit is essentially a SHA-1 hash.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;A branch or a tag is nothing but a pointer pointing at the SHA-1 hash of a commit. Moreover, &lt;code class="verbatim"&gt;HEAD&lt;/code&gt; is also a pointer, which always points the active branch at the time.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div id="outline-container-headline-3" class="outline-3"&gt;&#10;&lt;h3 id="headline-3"&gt;&#10;Areas&#10;&lt;/h3&gt;&#10;&lt;div id="outline-text-headline-3" class="outline-text-3"&gt;&#10;&lt;p&gt;In the utilization of git, there are four important areas for storage, &lt;em&gt;workspace&lt;/em&gt;, &lt;em&gt;index&lt;/em&gt; (or &lt;em&gt;stage&lt;/em&gt;), &lt;em&gt;repository&lt;/em&gt; and &lt;em&gt;remote&lt;/em&gt;. Their relationship can be illustrated by the figure below.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="./git.png" alt="./git.png" title="./git.png" /&gt;&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;</description></item></channel></rss>