<?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 Yoke Keong</title><link>https://yokekeong.com/blog/git/</link><description>Recent content in Git on Yoke Keong</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 20 Aug 2019 12:00:03 +0000</lastBuildDate><atom:link href="https://yokekeong.com/blog/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Note on tracking dotfiles across multiple instances easily with git</title><link>https://yokekeong.com/note-on-tracking-dotfiles-across-multiple-instances-easily-with-git/</link><pubDate>Tue, 20 Aug 2019 12:00:03 +0000</pubDate><guid>https://yokekeong.com/note-on-tracking-dotfiles-across-multiple-instances-easily-with-git/</guid><description>&lt;p&gt;Came across fast.ai&amp;rsquo;s &lt;a href="https://github.com/fastai/dotfiles"&gt;dotfiles repo&lt;/a&gt;, which provided gems of insight into &lt;a href="https://www.atlassian.com/git/tutorials/dotfiles"&gt;managing dotfiles&lt;/a&gt; in Linux (and Windows WSL) environment by using git bare repos. The repo also provided a very good quick start for some common command line configs. When you are working on various compute instances on cloud and/or on local, it is very handy to track and transfer dotfiles easily.&lt;/p&gt;&#10;&lt;h2 id="from-scratch"&gt;From scratch&lt;/h2&gt;&#10;&lt;p&gt;Create an empty repo on Github/Bitbucket/Gitlab named &lt;code&gt;dotfiles&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Handling line endings on Windows with git</title><link>https://yokekeong.com/handling-line-endings-on-windows-with-git/</link><pubDate>Tue, 07 Apr 2015 11:00:27 +0000</pubDate><guid>https://yokekeong.com/handling-line-endings-on-windows-with-git/</guid><description>&lt;p&gt;Note to self: When collaborating on different platforms, one of the most common issue is line endings - LF on Mac/Linux and CRLF on Windows. With git, you can address this issue in the following ways:&lt;/p&gt;&#10;&lt;h4 id="1-configure-global-settings"&gt;1) Configure Global Settings&lt;/h4&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Windows users: &lt;code&gt;git config --global core.autocrlf true&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Mac/Linux users: &lt;code&gt;git config --global core.autocrlf input&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h4 id="2-configure-per-repository-settings"&gt;2) Configure Per-repository settings&lt;/h4&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;1&lt;/span&gt;&lt;span&gt;echo &amp;#34;* text=auto&amp;#34; &amp;gt; .gitattributes&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;2&lt;/span&gt;&lt;span&gt;git add .&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;3&lt;/span&gt;&lt;span&gt;git commit -m &amp;#34;Files play nice in Mac, Linux and Windows&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;4&lt;/span&gt;&lt;span&gt;git push origin master&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Additional reading:&#10;&lt;a href="http://stackoverflow.com/questions/170961/whats-the-best-crlf-carriage-return-line-feed-handling-strategy-with-git"&gt;StackOverflow thread&lt;/a&gt; &lt;a href="https://help.github.com/articles/dealing-with-line-endings/#platform-all"&gt;Github help&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>