<?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 Junian Dev</title>
    <link>https://www.junian.dev/tags/git/</link>
    <description>Recent content in Git on Junian Dev</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>author@junian.dev (Junian Triajianto)</managingEditor>
    <webMaster>author@junian.dev (Junian Triajianto)</webMaster>
    <copyright>Copyright &amp;copy; 2014 - 2026 Junian.dev</copyright>
    
	    <atom:link href="https://www.junian.dev/tags/git/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>How to Create an Empty Orphan Git Branch</title>
      <link>https://www.junian.dev/dev/git-create-orphan-branch/</link>
      <pubDate>Fri, 06 Feb 2026 19:00:00 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/git-create-orphan-branch/</guid>
      <description>&lt;p&gt;Have you ever wanted to create a new, separate Git branch that doesn’t have any starting point from an existing branch?&lt;/p&gt;
&lt;p&gt;One common use case is from the early days of GitHub, when you needed to create a separate empty branch called &lt;code&gt;gh-pages&lt;/code&gt;. This branch was orphaned, meaning it had no relationship to the &lt;code&gt;master&lt;/code&gt; or &lt;code&gt;main&lt;/code&gt; branch, and was used to publish documentation sites to GitHub Pages.&lt;/p&gt;
&lt;p&gt;This approach makes sense because you don’t want to upload your application source code from the &lt;code&gt;main&lt;/code&gt; branch to GitHub Pages—only the static assets such as HTML, CSS, JavaScript, and other resources required for a static site.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fix Git Refusing to Merge Unrelated Histories Issue</title>
      <link>https://www.junian.dev/dev/git-refusing-to-merge-unrelated-histories/</link>
      <pubDate>Thu, 25 Sep 2025 03:00:21 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/git-refusing-to-merge-unrelated-histories/</guid>
      <description>&lt;p&gt;When I tried to merge a &lt;code&gt;git&lt;/code&gt; branch from a different repository, I got the following error:&lt;/p&gt;

&lt;figure class=&#34;highlight&#34;&gt;
    &lt;button class=&#34;btn-clipboard chroma&#34; title=&#34;Copy to clipboard&#34;&gt;&lt;i class=&#34;fa icon-clipboard&#34;&gt;&lt;svg xmlns=&#34;http://www.w3.org/2000/svg&#34; viewBox=&#34;0 0 24 24&#34; class=&#34;feather feather-copy&#34;&gt;&lt;rect x=&#34;9&#34; y=&#34;9&#34; width=&#34;13&#34; height=&#34;13&#34; rx=&#34;2&#34; ry=&#34;2&#34;/&gt;&lt;path d=&#34;M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1&#34;/&gt;&lt;/svg&gt;&lt;/i&gt;&lt;span class=&#34;msg-clipboard&#34;&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;% git merge development-branch
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;fatal: refusing to merge unrelated histories&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
    
&lt;/figure&gt;&lt;p&gt;Git is refusing to merge the branch because the histories do not share a common ancestor.&lt;/p&gt;
&lt;p&gt;The error message &lt;code&gt;fatal: refusing to merge unrelated histories&lt;/code&gt; means that the two branches have completely separate histories.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Set the Default GitHub Branch to &#39;master&#39;</title>
      <link>https://www.junian.dev/dev/github-master-branch/</link>
      <pubDate>Tue, 09 Sep 2025 12:27:54 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/github-master-branch/</guid>
      <description>&lt;p&gt;Consider this scenario where you create a new Git repository using the command-line tool.&lt;/p&gt;

&lt;figure class=&#34;highlight&#34;&gt;
    &lt;button class=&#34;btn-clipboard chroma&#34; title=&#34;Copy to clipboard&#34;&gt;&lt;i class=&#34;fa icon-clipboard&#34;&gt;&lt;svg xmlns=&#34;http://www.w3.org/2000/svg&#34; viewBox=&#34;0 0 24 24&#34; class=&#34;feather feather-copy&#34;&gt;&lt;rect x=&#34;9&#34; y=&#34;9&#34; width=&#34;13&#34; height=&#34;13&#34; rx=&#34;2&#34; ry=&#34;2&#34;/&gt;&lt;path d=&#34;M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1&#34;/&gt;&lt;/svg&gt;&lt;/i&gt;&lt;span class=&#34;msg-clipboard&#34;&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ mkdir new-repo
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ &lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; new-repo
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ git init
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Initialized empty Git repository in /Users/junian/new-repo/.git/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ touch README.md
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ git add .
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;Init&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;master &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;root-commit&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; d088569&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Init
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; file changed, &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; insertions&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;+&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;, &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; deletions&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;-&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; create mode &lt;span class=&#34;m&#34;&gt;100644&lt;/span&gt; README.md
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ git status
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;On branch master
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;nothing to commit, working tree clean&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
    
&lt;/figure&gt;&lt;p&gt;As you can see, the &lt;code&gt;git&lt;/code&gt; CLI still defaults to the &lt;code&gt;master&lt;/code&gt; branch. I respect that and am fine with it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Git Pull &#39;Rebase in Progress&#39; Issue</title>
      <link>https://www.junian.dev/dev/git-pull-rebase-in-progress/</link>
      <pubDate>Mon, 10 Mar 2025 10:00:13 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/git-pull-rebase-in-progress/</guid>
      <description>&lt;p&gt;When I tried to pull a Git repository with &lt;strong&gt;SourceTree&lt;/strong&gt;, I encountered the following error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rebase In Progress&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It appears that you have a rebase in progress that was probably interrupted because of a conflict. If you&amp;rsquo;ve resolved the conflicts in your working copy, please choose whether to continue the rebase or abort this process where you are now.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
    &lt;img src=&#34;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0hzeFZy0H_EiffF45kUpMVeZp6sr6XZD266jxjf77LeRuYZVshW-IFXXpepahH2aPJEWIvmI5RqPTXSjjxobjf46hvrDcuKIoe7Yaq-QXpW1UKPfchJtkSw_QNSYMFJc_SUM-9R-3W5T0cZF_RxyWUu5aN6Zn9IwO0RXG5X6WCyB6lZQ0j59MUCyVqP4D/s1600/git-pull-rebase-in-progress.png&#34; alt=&#34;Git Pull &amp;lsquo;Rebase In Progress&amp;rsquo; issue&#34;loading=&#34;lazy&#34;
    &gt;&lt;figcaption&gt;Git Pull &amp;lsquo;Rebase In Progress&amp;rsquo; issue&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;I didn&amp;rsquo;t remember &lt;strong&gt;whether&lt;/strong&gt; I had been doing a Git rebase before.
But well, let&amp;rsquo;s try to fix it in the Terminal.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Automating Git Cleanup Across Multiple Directories with a Shell Script</title>
      <link>https://www.junian.dev/dev/multiple-git-repos-cleanup/</link>
      <pubDate>Tue, 17 Dec 2024 15:42:26 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/multiple-git-repos-cleanup/</guid>
      <description>&lt;p&gt;Managing multiple Git repositories can be a tedious task.
One task I often perform is ensuring each repository is clean and reset to its original state.
Instead of manually navigating into each directory and running Git commands, I like to automate the process with a simple shell script.&lt;/p&gt;
&lt;h2 id=&#34;objective-of-the-script&#34;&gt;Objective of the Script&lt;/h2&gt;
&lt;p&gt;This script automates two key tasks for all Git repositories in the current working directory:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;git clean -fdx&lt;/code&gt;&lt;/strong&gt;: Removes untracked files, directories, and ignored files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;git reset --hard HEAD&lt;/code&gt;&lt;/strong&gt;: Resets the repository to the last commit, discarding all local changes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The script loops through each directory, checks if it’s a Git repository, and then performs the cleanup operations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Text-Based Password Manager</title>
      <link>https://www.junian.dev/dev/text-based-password-manager/</link>
      <pubDate>Tue, 16 Apr 2019 10:57:29 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/text-based-password-manager/</guid>
      <description>&lt;p&gt;Everyone needs a password manager.
I have dozens of credentials to several websites.
Re-using password across websites is no.
Memorizing dozens of different password is also a no.
The only way is to use a password manager.&lt;/p&gt;
&lt;p&gt;For so long, I&amp;rsquo;ve been searching for the simplest possible password manager.
I only need two criteria: plaintext and git-friendly.&lt;/p&gt;
&lt;h2 id=&#34;why-plaintext&#34;&gt;Why Plaintext?&lt;/h2&gt;
&lt;p&gt;Yeah, you heard that right, it has to be plaintext.
But that doesn&amp;rsquo;t mean it has to be stored as real plain text, where everyone or every machine can read it.
That would be so wrong.
What I mean is it has to be stored as simple text files, not binary.
If you ever see the content of your public and private ssh keys, that&amp;rsquo;s what I mean.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Local Git Server</title>
      <link>https://www.junian.dev/dev/local-git-server/</link>
      <pubDate>Mon, 15 Apr 2019 13:17:17 +0700</pubDate>
      <author>author@junian.dev (Junian Triajianto)</author>
      <guid>https://www.junian.dev/dev/local-git-server/</guid>
      <description>&lt;p&gt;In this tutorial, I&amp;rsquo;ll show you how to create a git server in your local network.&lt;/p&gt;
&lt;p&gt;You might be thinking why would I?
Usually, when we&amp;rsquo;re working git repository, we go to online services like GitHub.
We create a private project for privacy.
But that&amp;rsquo;s not enough for all cases.&lt;/p&gt;
&lt;p&gt;You maybe need a git repository to store &lt;a href=&#34;https://www.passwordstore.org/&#34;&gt;password&lt;/a&gt;.
Putting it in a cloud service is not cool.&lt;/p&gt;
&lt;p&gt;There is a very simple way to set up your own git server.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
