<?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 Saroj Maharjan</title>
		<link>https://sarojmaharjan.com/tags/git/</link>
		<description>Recent content in Git on Saroj Maharjan</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
			<copyright>&amp;copy; All rights reserved.</copyright>
		
		
			<lastBuildDate>Fri, 02 Oct 2026 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://sarojmaharjan.com/tags/git/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Make git init Default to the Master Branch</title>
				<link>https://sarojmaharjan.com/blog/git-init-default-branch-master/</link>
				<pubDate>Fri, 02 Oct 2026 00:00:00 +0000</pubDate>
				<guid>https://sarojmaharjan.com/blog/git-init-default-branch-master/</guid>
				<description>&lt;p&gt;I prefer &lt;code&gt;master&lt;/code&gt; over &lt;code&gt;main&lt;/code&gt;, and I want &lt;code&gt;git init&lt;/code&gt; to stop assuming otherwise.&lt;/p&gt;&#xA;&lt;p&gt;Git lets you decide.&lt;/p&gt;&#xA;&lt;h2 id=&#34;set-it-globally&#34;&gt;Set it globally&lt;/h2&gt;&#xA;&lt;p&gt;Run this once:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git config --global init.defaultBranch master&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Every new repository you create from now on starts on &lt;code&gt;master&lt;/code&gt;, and Git stays quiet about it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;verify-it&#34;&gt;Verify it&lt;/h2&gt;&#xA;&lt;p&gt;For reference, every output in this post comes from:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ git --version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git version 2.54.0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Read the value back straight from your global config:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
