<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Srebalaji Thirumalai</title>
    <description>The latest articles on Forem by Srebalaji Thirumalai (@srebalaji).</description>
    <link>https://forem.com/srebalaji</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F12128%2F7547224.jpeg</url>
      <title>Forem: Srebalaji Thirumalai</title>
      <link>https://forem.com/srebalaji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/srebalaji"/>
    <language>en</language>
    <item>
      <title>How to add multiple authors to a commit in Github</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Mon, 03 Apr 2023 09:00:52 +0000</pubDate>
      <link>https://forem.com/srebalaji/how-to-add-multiple-authors-to-a-commit-in-github-5a4j</link>
      <guid>https://forem.com/srebalaji/how-to-add-multiple-authors-to-a-commit-in-github-5a4j</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F377a4807-a783-44b8-a614-02f5ff41c8eb_1024x666.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F377a4807-a783-44b8-a614-02f5ff41c8eb_1024x666.webp" alt="multiple authors to a commit in github"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Github supports to add multiple authors to a single commit.&lt;/p&gt;

&lt;p&gt;This feature is helpful when developers do pair programming. So it will be clear who contributed to the commit. And their contribution gets attribution in the pull request and in their contribution graph.&lt;/p&gt;

&lt;p&gt;And moreover adding co-authors is so simple.&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding co-authors
&lt;/h4&gt;

&lt;p&gt;You have to mention the author’s info in the commit message as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Commit message&amp;gt;

Co-authored-by: Jon Snow &amp;lt;jon@gmail.com&amp;gt;
Co-authored-by: Tyrian &amp;lt;tyrian@users.noreply.github.com&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above snippet, you can see we should add &lt;strong&gt;Co-authored-by&lt;code&gt;&lt;/code&gt;&lt;/strong&gt; label. You can add multiple authors as you need.&lt;/p&gt;

&lt;p&gt;And remember you should leave at least one line of white space.&lt;/p&gt;

&lt;p&gt;Sometimes the author’s email address won’t be public. So Github will be providing a private email address to that user. You can use that email address too for privacy reasons.&lt;/p&gt;

&lt;p&gt;You can see I have used a private email address for the user &lt;strong&gt;Tyrian&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F60eaa186-39b4-4e0d-b805-b71942ee40de_682x326.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F60eaa186-39b4-4e0d-b805-b71942ee40de_682x326.png" alt="github co-author"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;In the above image, you can see I’m adding a co-author.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fbd41cb11-c65f-4a13-8165-344fc89f6628_612x191.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fbd41cb11-c65f-4a13-8165-344fc89f6628_612x191.png" alt="github co-author"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And in Github you can see it’s showing two authors have contributed to the commit.&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;h4&gt;
  
  
  Using vs-code extension
&lt;/h4&gt;

&lt;p&gt;If you are using vs-code then adding co-authors is much more simpler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=drrouman.git-coauthors" rel="noopener noreferrer"&gt;Git Co-Authors&lt;/a&gt;&lt;/strong&gt; is a handy vs-code extension you can use to add co-authors to your repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F4f690b98-f373-4b24-a0b4-b2e6af9a5301_569x267.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F4f690b98-f373-4b24-a0b4-b2e6af9a5301_569x267.gif" alt="github co-authors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;h4&gt;
  
  
  git-coauthor - Simple multiple author support porcelain for git
&lt;/h4&gt;

&lt;p&gt;I found another helpful tool &lt;strong&gt;&lt;a href="https://github.com/simoleone/git-coauthor" rel="noopener noreferrer"&gt;git-coauthor&lt;/a&gt;&lt;/strong&gt; which is very lightweight tool written in bash.&lt;/p&gt;

&lt;p&gt;The usage is very simple. You can add co-authors to a list and use them as appropriate.&lt;/p&gt;

&lt;p&gt;And it also has option to switch to solo commits and to co-authors commits easily. This is one of my personal favorite.&lt;/p&gt;

&lt;p&gt;Github support for co-authors is a useful feature you can start using. And it comes in handy when you do pair programming.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Dev News - Top articles this week for developers</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sun, 18 Oct 2020 14:24:13 +0000</pubDate>
      <link>https://forem.com/srebalaji/dev-new-top-articles-this-week-for-developers-89c</link>
      <guid>https://forem.com/srebalaji/dev-new-top-articles-this-week-for-developers-89c</guid>
      <description>&lt;p&gt;Hey Devs&lt;/p&gt;

&lt;p&gt;I have compiled a list of top articles from last week that you might find interesting&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;a href="https://www.reddit.com/r/jobs/comments/jbod57/a_warning_about_glassdoor/"&gt;A warning about Glassdoor&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many developers rely on Glassdoor for company reviews. But is Glassdoor really that reliable to look for the company review. This article reflects a perspective about Glassdoor&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;a href="https://twitter.com/tim_nolet/status/1317061818574082050"&gt;Seems like AWS forked an open-source project and presented themselves a new service&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Twitter user &lt;a class="comment-mentioned-user" href="https://dev.to/tim_nolet"&gt;@tim_nolet&lt;/a&gt;
 claims that AWS has forked this project and started with a new service. Of course, it's legal but you know?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;a href="https://dev.to/benjaminmock/vs-code-extensions-to-become-a-more-productive-developer-5a62"&gt;VS-Code extension to make your life easier&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This post lists some useful VS-Code extensions to help you write software better. My favorite on the list is Bracket Pair Colorizer, an Indent rainbow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. &lt;a href="https://www.freecodecamp.org/news/course-on-docker-and-kubernetes/"&gt;Free course on Docker and Kubernetes&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This free course published on the FreeCodeCamp youtube channel that helps beginners learn the fundamentals of Docker and Kubernetes better. Containers have changed how we deliver Software so learning them gives you much advantage.  This course covers docker architecture, images, volumes, and Kubernetes pods, services, configs, etc. Much recommended.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. &lt;a href="https://www.classcentral.com/report/stanford-on-campus-courses/"&gt;150+ Stanford Computer Science is available online&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CS Degree has seen big popularity in the last decade. And that popularity is not going anywhere. This article lists down nearly 150 courses from Stanford that are found online.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. &lt;a href="https://www.quantamagazine.org/computer-scientists-break-traveling-salesperson-record-20201008/"&gt;Computer Scientists Break Traveling Salesperson Record&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After nearly 44 years, scientists have found a better way to approximate solutions to the notoriously difficult traveling salesperson problem. Traveling salesperson problem has applications ranging from DNA sequencing to ride-sharing logistics. So finding a better solution to seek the shortest round trip is truly inspiring. Read the full article on finding how traveling  salesperson has been a real challenge in CS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. &lt;a href="https://github.blog/2020-10-14-how-we-open-sourced-docs-github-com/"&gt;docs.github.com is open-sourced&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Github open-sourced all of its product documentation. This will help in understanding how Github application design, workflow really works, and how we can benefit from it. And the company claims it is the first private production service that we’ve migrated into the open.&lt;/p&gt;

&lt;p&gt;That's it :)&lt;/p&gt;

&lt;p&gt;I hope you find it useful &lt;/p&gt;

&lt;p&gt;Thank you for reading :) :)&lt;/p&gt;

</description>
      <category>programming</category>
      <category>showdev</category>
      <category>discuss</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to use emoji in your commit message ⚡ ⚡</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sun, 04 Oct 2020 06:57:18 +0000</pubDate>
      <link>https://forem.com/srebalaji/how-to-use-emoji-in-your-commit-message-253g</link>
      <guid>https://forem.com/srebalaji/how-to-use-emoji-in-your-commit-message-253g</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F1f01be07-b83d-41cf-b852-732b7282b4dc_540x540.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F1f01be07-b83d-41cf-b852-732b7282b4dc_540x540.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this edition let’s see how to use emoji in your commits messages.&lt;/p&gt;

&lt;p&gt;Using emojis in your commit messages will be fun (😊) and cool (😎) in the first place.&lt;/p&gt;

&lt;p&gt;And another use case I can think of is you can understand the purpose and intention of the commits very easily if you are following standardized rules for adding emoji.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using Gitmoji in your commit
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://gitmoji.carloscuesta.me/" rel="noopener noreferrer"&gt;Gitmoji&lt;/a&gt;&lt;/strong&gt; is one of the fine guides you can refer to add emoji in our commits.&lt;/p&gt;

&lt;p&gt;You can see a list of emoji with their code. You can simply use this code in your code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m ":bug: Fix Bug BD-1910"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fbd973ab4-7749-464b-8744-ffa11f64a650_639x190.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fbd973ab4-7749-464b-8744-ffa11f64a650_639x190.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see our bug emoji in Github.&lt;/p&gt;

&lt;p&gt;Also, know that these Gitmoji won’t show up in the terminal without additional configuration.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using gitmoji-cli
&lt;/h4&gt;

&lt;p&gt;Another easy option is using &lt;strong&gt;&lt;a href="https://github.com/carloscuesta/gitmoji-cli" rel="noopener noreferrer"&gt;gitmoji-cli&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gitmoji-cli gives an interactive option to add emoji in your commit. This is one of the easiest options to add emoji in your commit messages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F102813c9-8006-4ba3-bd14-acd14d4bacf9_1720x580.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F102813c9-8006-4ba3-bd14-acd14d4bacf9_1720x580.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image, you can see how the user is prompted to add respective emoji using auto-complete from the Gitmoji guide. Then an appropriate commit title and message.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using gitmoji-vscode for VSCode users
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/vtrois/gitmoji-vscode" rel="noopener noreferrer"&gt;gitmoji-vscode&lt;/a&gt;&lt;/strong&gt; is a VSCode extension that helps you to add emoji right from your editor itself. This will come in handy if you are already a fan of the Git feature in VSCode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F86a06976-1ae4-4e34-a495-38bd51ec7bd9_1084x741.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F86a06976-1ae4-4e34-a495-38bd51ec7bd9_1084x741.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also find gitmoji supported extension for your favorite editor too.&lt;/p&gt;

&lt;p&gt;Apart from all the above-mentioned methods, You can also take a look at &lt;strong&gt;&lt;a href="https://github.com/ahmadawais/Emoji-Log" rel="noopener noreferrer"&gt;Emoji-log&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This repo contains an experimental short standard for adding emoji in your commits. You can take inspiration from this repo and start using it in your repo with ease.&lt;/p&gt;

&lt;p&gt;It also contains a few code snippets and aliases that you can start using right away.&lt;/p&gt;

&lt;p&gt;And apart from these methods, you can just copy-paste emoji from the internet too 😂&lt;/p&gt;

&lt;p&gt;That will work too but I know its a boring process and it may not support all systems.&lt;/p&gt;

&lt;p&gt;Using a proper emoji standard can really help give your commits a real meaning. And of course, it will be fun and colorful to use too 😃 😈&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to reset a file to an old revision</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sun, 04 Oct 2020 06:54:11 +0000</pubDate>
      <link>https://forem.com/srebalaji/how-to-reset-a-file-to-an-old-revision-8bh</link>
      <guid>https://forem.com/srebalaji/how-to-reset-a-file-to-an-old-revision-8bh</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HhpTj9tZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F1d25e844-6d65-4fef-85e6-2dfbb21d3bb3_885x332.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HhpTj9tZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F1d25e844-6d65-4fef-85e6-2dfbb21d3bb3_885x332.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this post let’s see different ways of resetting a file to a particular revision. This may come in handy in many situations.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using checkout
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;commit_hash_id&amp;gt; -- &amp;lt;file_path&amp;gt;

Example
git checkout cc1d4a7 -- example.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I think the above command is very self-explanatory.&lt;/p&gt;

&lt;p&gt;You are reverting a file to a particular commit. In other words, git will take the mentioned file and apply the mentioned commit changes to it.&lt;/p&gt;

&lt;p&gt;You can mention multiple files to revert too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout cc1d4a7 -- example.py index.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Using restore
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore --source &amp;lt;commit_hash_id&amp;gt; &amp;lt;file_path&amp;gt;

Example
git restore --source cc1d4a7 index.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We have seen &lt;strong&gt;restore&lt;/strong&gt; in our previous edition. Restore is a new command and it helps in restoring a particular revision.&lt;/p&gt;

&lt;p&gt;In the above command, we are using the &lt;strong&gt;—source&lt;/strong&gt; option to tell restore to use only the particular commit hash. And we have also mentioned the file path to apply the changes only to the mentioned file.&lt;/p&gt;

&lt;p&gt;You can use any of the above commands to reset a file. My personal favorite is &lt;strong&gt;restore&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How often you read (big) technical articles fully</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Wed, 30 Sep 2020 07:40:23 +0000</pubDate>
      <link>https://forem.com/srebalaji/how-often-you-read-big-technical-articles-fully-2lbm</link>
      <guid>https://forem.com/srebalaji/how-often-you-read-big-technical-articles-fully-2lbm</guid>
      <description>&lt;p&gt;Hey Devs&lt;/p&gt;

&lt;p&gt;How many of you read technical articles fully.&lt;/p&gt;

&lt;p&gt;I used to read a lot of technical articles from different sites and I mostly skim through the articles.&lt;/p&gt;

&lt;p&gt;Only very few (big) articles I used to read it fully.&lt;/p&gt;

&lt;p&gt;And when it comes to listicles I mostly read it fully and bookmark it :P&lt;/p&gt;

&lt;p&gt;And most listicles I see have much traction and engagement than other articles especially big and thorough articles.&lt;/p&gt;

&lt;p&gt;What is your take on this? And how often you read big technical articles completely or you just skim through most of it&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to use git restore effectively</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sat, 26 Sep 2020 13:27:36 +0000</pubDate>
      <link>https://forem.com/srebalaji/how-to-use-git-restore-effectively-1n7o</link>
      <guid>https://forem.com/srebalaji/how-to-use-git-restore-effectively-1n7o</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F40dfcf90-e67e-4e7a-9114-bb85d109e801_1000x420.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F40dfcf90-e67e-4e7a-9114-bb85d109e801_1000x420.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;git restore&lt;/strong&gt; is used to restore or discard the uncommitted local changes of files.&lt;/p&gt;

&lt;p&gt;Assume that you have done some changes in some files and then if you want to discard those local changes you can safely use &lt;strong&gt;git restore&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Another use case is if you want to unstage a file you can use this command. In other words, it is used to undo the effects of &lt;strong&gt;git add&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore &amp;lt;file_name&amp;gt;

Example:
git restore example.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F791d7c0e-4c58-463c-8165-1baaeb5c3f04_603x370.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F791d7c0e-4c58-463c-8165-1baaeb5c3f04_603x370.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image, you can see that we have used git restore to discard the local changes of a file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other options&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore one.txt two.txt // Mention multiple files

git restore . // Discard all local changes

git restore *.rb // Wildcard option
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Unstage files
&lt;/h4&gt;

&lt;p&gt;As said earlier, you can also use this command to unstage a file from the staging area.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore --staged &amp;lt;file_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F806b41c4-437e-43a5-9dbd-c10838394808_641x601.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F806b41c4-437e-43a5-9dbd-c10838394808_641x601.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see that the mentioned file is unstaged but the local changes of the files are still present.&lt;/p&gt;

&lt;h4&gt;
  
  
  Source option
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore --source &amp;lt;source_id/commit_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The source option is used to restore a file from a particular commit. By default, restore will take the contents from &lt;strong&gt;HEAD&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore --source f9456ba one.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above command, we are restoring a file from a mentioned commit.&lt;/p&gt;

&lt;h4&gt;
  
  
  Patch option
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore one.txt -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F9d16a55d-760a-4529-bc01-209df1f639dc_522x219.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F9d16a55d-760a-4529-bc01-209df1f639dc_522x219.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, you can select the chunks interactively.&lt;/p&gt;

&lt;p&gt;git restore is one of the useful commands you can start using it in your workflow. It is marked as experimental in git docs but it’s not a very destructive command that you have to worry about.&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Forgit - A utility tool to use git interactively</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sat, 26 Sep 2020 13:25:01 +0000</pubDate>
      <link>https://forem.com/srebalaji/forgit-a-utility-tool-to-use-git-interactively-2ah2</link>
      <guid>https://forem.com/srebalaji/forgit-a-utility-tool-to-use-git-interactively-2ah2</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F00748290-edc8-401b-852e-e760904d4976_940x788.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F00748290-edc8-401b-852e-e760904d4976_940x788.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Forgit&lt;/strong&gt; is a lightweight CLI tool that helps you to use Git interactively. This tool is a very useful tool that helps you to work effectively.&lt;/p&gt;

&lt;p&gt;You can view the repo &lt;strong&gt;&lt;a href="https://github.com/wfxr/forgit" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;a href="https://github.com/wfxr/forgit" rel="noopener noreferrer"&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;

&lt;p&gt;This tool uses &lt;strong&gt;&lt;a href="https://github.com/junegunn/fzf" rel="noopener noreferrer"&gt;&lt;code&gt;fzf&lt;/code&gt;&lt;/a&gt;&lt;code&gt;.&lt;/code&gt;&lt;/strong&gt;So don’t forget to download it.&lt;/p&gt;

&lt;p&gt;To install fzf, follow &lt;strong&gt;&lt;a href="https://github.com/junegunn/fzf#installation" rel="noopener noreferrer"&gt;&lt;code&gt;these instructions&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; for your respective platforms.&lt;/p&gt;

&lt;p&gt;To install Forgit,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download the source from the repo.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;strong&gt;.bashrc&lt;/strong&gt; or &lt;strong&gt;.zshrc&lt;/strong&gt; and add &lt;strong&gt;forgit.plugin.sh or forgit.plugin.zsh&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;source .bashrc&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;source .zshrc&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;p&gt;Some of the useful commands in Forgit&lt;/p&gt;

&lt;h4&gt;
  
  
  git add
&lt;/h4&gt;

&lt;p&gt;The default command is &lt;strong&gt;ga&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F733ab82e-df82-4341-99f7-7d728ec2f61b_2066x1294.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F733ab82e-df82-4341-99f7-7d728ec2f61b_2066x1294.png" alt="https://raw.githubusercontent.com/wfxr/i/master/forgit-ga.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image, you can see the interactive screen.&lt;/p&gt;

&lt;p&gt;You can use &lt;strong&gt;&lt;code&gt;arrow keys&lt;/code&gt;&lt;/strong&gt; to navigate up and down.&lt;/p&gt;

&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;Tab&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;Shift-Tab&lt;/code&gt;&lt;/strong&gt; to add/remove the file.&lt;/p&gt;

&lt;h4&gt;
  
  
  git log
&lt;/h4&gt;

&lt;p&gt;The default command is &lt;strong&gt;glo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F506128fa-2836-4c13-90ad-5b1e8ab533c3_2066x1294.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F506128fa-2836-4c13-90ad-5b1e8ab533c3_2066x1294.png" alt="screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the tool uses fzf, you can fuzzy search the logs.&lt;/p&gt;

&lt;h4&gt;
  
  
  git stash
&lt;/h4&gt;

&lt;p&gt;The default command is &lt;strong&gt;gss&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fa35d7cf7-f533-4de4-aa4e-a2a6fdf22baa_810x462.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.substack.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fa35d7cf7-f533-4de4-aa4e-a2a6fdf22baa_810x462.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Change default alias
&lt;/h4&gt;

&lt;p&gt;Forgit also gives the option to change the default aliases.&lt;/p&gt;

&lt;p&gt;Just configure these variables in your shell and source it. Some of the common variables are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;forgit_log=glo

forgit_diff=gd

forgit_add=ga

forgit_stash_show=gss

forgit_cherry_pick=gcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the full list of options, you can see &lt;a href="https://github.com/wfxr/forgit#--options" rel="noopener noreferrer"&gt;this configuration&lt;/a&gt; to change the aliases.&lt;/p&gt;

&lt;p&gt;Forgit may take some time to fit in your workflow but it’s a very useful tool that comes in handy in many places.&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/" rel="noopener noreferrer"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Introducing Go tutorial series</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sat, 05 Sep 2020 09:04:29 +0000</pubDate>
      <link>https://forem.com/srebalaji/introducing-go-tutorial-series-347f</link>
      <guid>https://forem.com/srebalaji/introducing-go-tutorial-series-347f</guid>
      <description>&lt;p&gt;Hey Devs&lt;/p&gt;

&lt;p&gt;I'm starting a tutorial series to learn Go from scratch.&lt;/p&gt;

&lt;p&gt;This series will help people to learn the language from scratch and will be covering advanced topics.&lt;/p&gt;

&lt;p&gt;Lately, I was reading about learning in public. So I thought of just trying this out in small steps.&lt;/p&gt;

&lt;p&gt;And I will be updating all my notes in my blog.&lt;/p&gt;

&lt;p&gt;Let's see how it goes :) :)&lt;/p&gt;

</description>
      <category>programming</category>
      <category>go</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Branch based vs Trunk based development</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sat, 05 Sep 2020 08:41:45 +0000</pubDate>
      <link>https://forem.com/srebalaji/branch-based-vs-trunk-based-development-557a</link>
      <guid>https://forem.com/srebalaji/branch-based-vs-trunk-based-development-557a</guid>
      <description>&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Choosing the right-branching model can save you a lot of time in development. It also helps your dev team to work efficiently.&lt;/p&gt;

&lt;p&gt;Coming to the point, we are gonna discuss two branching models today&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Branch based&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trunk based&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Branch based development
&lt;/h4&gt;

&lt;p&gt;This is a very common strategy and most of them know it.&lt;/p&gt;

&lt;p&gt;You have a stable branch like a &lt;em&gt;&lt;strong&gt;master.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then you have a feature branch like &lt;em&gt;&lt;strong&gt;develop&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So whenever you develop new features or fix any bugs, you take a branch from &lt;em&gt;&lt;strong&gt;develop&lt;/strong&gt;&lt;/em&gt; and finish your work.&lt;/p&gt;

&lt;p&gt;Then you raise a PR to the feature branch. After the code review, the branch will be merged.&lt;/p&gt;

&lt;p&gt;When you have finalized the changes, then you merge the feature branch to &lt;em&gt;&lt;strong&gt;master&lt;/strong&gt;&lt;/em&gt; for the main release.&lt;/p&gt;

&lt;p&gt;I know how common it is. Most of the open-source software use this method.&lt;/p&gt;

&lt;h4&gt;
  
  
  Trunk based development
&lt;/h4&gt;

&lt;p&gt;On the other side, trunk based development doesn’t use branches or has very limited use of branches.&lt;/p&gt;

&lt;p&gt;You have the main branch like &lt;em&gt;&lt;strong&gt;master&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every developer will do all the changes in the main branch and push it directly to the main branch.&lt;/p&gt;

&lt;p&gt;There are no PRs, branches, merge conflicts.&lt;/p&gt;

&lt;p&gt;Just push directly to the main branch.&lt;/p&gt;

&lt;p&gt;Seems very dangerous right?&lt;/p&gt;

&lt;p&gt;With trunk-based development, you mostly can’t control who pushes the code and which code is being merged to the stable branch.&lt;/p&gt;

&lt;p&gt;But there are things we have to consider with Trunk based development.&lt;/p&gt;

&lt;p&gt;Trunk based development is useful when you want to deliver software in a fast phase.&lt;/p&gt;

&lt;p&gt;And this method is always accompanied by best practices in writing software like TDD, CI/CD integration, Automation testing, high code coverage, pair programming, etc.&lt;/p&gt;

&lt;p&gt;Trunk based development is a required practice of Continuous Integration (CI). With CI you get a deployment pipeline where you can run all tests and other integration jobs and safely deploy the code to production.&lt;/p&gt;

&lt;p&gt;Most companies who are practicing CI often welcome Trunk based strategy.&lt;/p&gt;

&lt;p&gt;Trunk based development is often practiced in a group of professional engineers. Because they have experience in writing software and know the best practices often. This comes with a high advantage.&lt;/p&gt;

&lt;p&gt;Imagine a small group of professional engineers (maybe 10) who know best practices in development like TDD, Automation testing, etc, and are following Trunk based development. This group can deliver software in a fast and efficient way to its full potential.&lt;/p&gt;

&lt;p&gt;This type of development is highly encouraged in Agile methodologies where you have to ship software frequently to get feedback often.&lt;/p&gt;

&lt;p&gt;One can always argue that with Trunk based development you have very limited control over the code being released. It’s true but with the best practices, it can always be mitigated.&lt;/p&gt;

&lt;p&gt;So choose your branching strategy wisely. If you need to deliver software in a fast phase, then Trunk based development is the best choice. On the other hand, if you need to tightly control the release you can follow a branch-based approach.&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Github CLI - bring Github to the command line</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Sat, 05 Sep 2020 08:35:32 +0000</pubDate>
      <link>https://forem.com/srebalaji/github-cli-bring-github-to-the-command-line-2ego</link>
      <guid>https://forem.com/srebalaji/github-cli-bring-github-to-the-command-line-2ego</guid>
      <description>&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Github CLI is one of the useful tools you can start using right away if you are a very active Github user.&lt;/p&gt;

&lt;p&gt;You can visit the &lt;a href="https://github.com/cli/cli"&gt;repo here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is still in beta but you can still use it. It brings PRs, issues, and other useful features of Github to the command line.&lt;/p&gt;

&lt;p&gt;I will cover some commands that I find very useful. And you can also play around with the tool.&lt;/p&gt;

&lt;h4&gt;
  
  
  Listing Pull requests
&lt;/h4&gt;

&lt;p&gt;You can list all the PRs of the repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There are options for filtering PRs with the assignee, base branch, labels.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt; :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr list --label "WIP, help" // List PRs with the provided labels

gh pr list --base "master" // List PRs with master as base

gh pr list --assignee "john" // List PRs with the respective assignee
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Creating a Pull request
&lt;/h4&gt;

&lt;p&gt;Creating a PR is very easy with CLI. This can make you really productive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr create
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command is a very basic option. This will create a PR with the _ &lt;strong&gt;master&lt;/strong&gt; _ as the base branch and the _ &lt;strong&gt;current branch&lt;/strong&gt; _ as the target branch.&lt;/p&gt;

&lt;p&gt;There are other options as well for changing the base branch, labeling, assigning people, etc&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt; :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr create --base develop // Here develop is the base branch

gh pr create --title "PR title" // Create a PR with title

gh pr create --reviewer "john, arya" // Assign reviewers

gh pr create --label "prod, help" // Assign labels
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  View Pull request change
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr diff &amp;lt;PR number / url&amp;gt;

Example
gh pr diff 3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will show the diff of the respective PR. This will come in handy if you are looking for small changes in PR.&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating an issue
&lt;/h4&gt;

&lt;p&gt;Creating a simple issue from the CLI will come in handy often.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue create --title "Search not working" --body "Search in main dashboard is not working"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will create a new issue with the respective title and body.&lt;/p&gt;

&lt;p&gt;There are like other useful options too&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue create --label "help, priority" // You can assign multiple labels

gh issue create --assignee "john, arya" // You can assign people
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Listing issues
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This will list all issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue list --label "help, priority" // List issues by labels

gh issue list --assignee "john, arya" // List issues by assignees

gh isssue list --author "srebalaji" // Lists issues by people who created the issue
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Creating gist
&lt;/h4&gt;

&lt;p&gt;This is one of my favorites. You can create a public or private gist from the command line itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh gist create main.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will create a private gist with the given file.&lt;/p&gt;

&lt;p&gt;By default, gists are made private.&lt;/p&gt;

&lt;p&gt;Other options,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh gist create --public main.js // Creating a public gist

gh gist create main.js -d "NodeJS example" // Creating a gist with a description

gh gist create main.py copy.py home.py // Creating a gist with multiple files

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Github CLI is a very useful command-line tool you can use. I have been using it for a couple of weeks and I can say it’s very useful. Of course, there are some hiccups but I believe it will be resolved in the upcoming versions.&lt;/p&gt;

&lt;p&gt;Highly recommended if you are using Github often.&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to change git default branch from master</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Tue, 25 Aug 2020 13:01:22 +0000</pubDate>
      <link>https://forem.com/srebalaji/how-to-change-git-default-branch-from-master-3ob3</link>
      <guid>https://forem.com/srebalaji/how-to-change-git-default-branch-from-master-3ob3</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K-8ZBhIc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fa5e782e0-90e4-41bd-a8c2-ad003d9ebf25_940x788.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K-8ZBhIc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fa5e782e0-90e4-41bd-a8c2-ad003d9ebf25_940x788.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Recently, there are many suggestions about renaming the default branch &lt;strong&gt;master&lt;/strong&gt; to some other name. This was mainly due to the master-slave metaphor that some people are talking about.&lt;/p&gt;

&lt;p&gt;There is &lt;a href="https://git.github.io/rev_news/2020/07/29/edition-65/"&gt;evidence&lt;/a&gt; that states it was intended to mention &lt;strong&gt;master-copy&lt;/strong&gt; or &lt;strong&gt;master recording.&lt;/strong&gt; And it is not intended to master-slave.&lt;/p&gt;

&lt;p&gt;But I think it’s people's perspective and if some think that they are not cool with that they can change the default branch.&lt;/p&gt;

&lt;p&gt;So let’s see how to change the default git branch _ &lt;strong&gt;master&lt;/strong&gt; _ to _ &lt;strong&gt;default&lt;/strong&gt; _ (you can use your preferred name)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before starting I have to tell you that I have tried this in multiple repos and its working fine without any breaking changes. If you are not confident enough then fork your repo and try it first.&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Prerequisites
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make sure your CI/CD flow doesn’t get interrupted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure you have merged all the PRs targeting &lt;strong&gt;master.&lt;/strong&gt; Other PRs are fine&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;There are three steps in renaming the default branch&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Change the branch name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set remote upstream tracking for the new branch&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Change the new branch name in repo host (Github, Gitlab)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Change the branch name
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -m master default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command just renames the default branch to the name &lt;strong&gt;default.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-m&lt;/strong&gt; attribute is used to rename the branch name without affecting the branch’s history.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K3ZZG_VX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F1a13be50-c3cd-4bc7-927b-d27e754fa7a1_473x217.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K3ZZG_VX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F1a13be50-c3cd-4bc7-927b-d27e754fa7a1_473x217.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the default branch is changed in the local but not in the remote.&lt;/p&gt;

&lt;h4&gt;
  
  
  Set remote upstream tracking for the new branch
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push -u origin default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will push the new branch to the remote.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-u&lt;/strong&gt; attribute is used to set the upstream tracking for the branch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tw6IjdH8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F8ddf2d63-43e7-45f8-80c3-7db5a74c7e79_673x429.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tw6IjdH8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F8ddf2d63-43e7-45f8-80c3-7db5a74c7e79_673x429.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see that the upstream is set for the new branch. But still, the reference to the old upstream is present in the local.&lt;/p&gt;

&lt;h4&gt;
  
  
  Change the new branch name in the repo host
&lt;/h4&gt;

&lt;p&gt;In this tutorial, let’s consider Github. But the same option is also available in Gitlab, Bitbucket.&lt;/p&gt;

&lt;p&gt;In Github, go to settings -&amp;gt; branches. You can change the default branch there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Efp3PWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F576656a1-1c1f-4231-a724-43a940bbeb20_1256x568.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Efp3PWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F576656a1-1c1f-4231-a724-43a940bbeb20_1256x568.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it you are done.&lt;/p&gt;

&lt;p&gt;But remember that the old branch’s upstream is still present. It won’t affect your workflow. But you should delete it to keep your repo clean.&lt;/p&gt;

&lt;p&gt;To delete the old branch’s upstream you can use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin --delete master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ofD4O-6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F18b478fe-e145-4a47-a108-0ddc90063d6c_627x331.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ofD4O-6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F18b478fe-e145-4a47-a108-0ddc90063d6c_627x331.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see the old remote stream is deleted.&lt;/p&gt;




&lt;p&gt;Now the changes are done in your local and in the remote host. Let’s see how to bring those to other people who are already using the repo.&lt;/p&gt;

&lt;p&gt;I mean there will be other people who will be using this repo. They have to do few changes to complete the flow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QRe2Pjq3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F87b808b2-d242-4ae5-9339-96a19e8a9e94_562x348.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QRe2Pjq3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F87b808b2-d242-4ae5-9339-96a19e8a9e94_562x348.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see still the branch &lt;strong&gt;master&lt;/strong&gt; is present in the local of others who are already using the repo.&lt;/p&gt;

&lt;h4&gt;
  
  
  There are three steps for people who are already using the repo
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Fetch all the branches&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update the upstream remote’s HEAD&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rename the default branch&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Fetch all the branches
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will just fetch all the remote branches to your local.&lt;/p&gt;

&lt;h4&gt;
  
  
  Update the upstream remote HEAD
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-head origin -a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will query the remote host for the HEAD upstream and it updates that upstream in the local.&lt;/p&gt;

&lt;h4&gt;
  
  
  Rename the default branch
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -m master default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is the same as the old one. We are just moving the branch without affecting the history of the branch.&lt;/p&gt;

&lt;p&gt;As we have already set the remote upstream in the previous step, the new branch is changed and is in sync with the remote.&lt;/p&gt;

&lt;p&gt;Now the person can work with the default branch.&lt;/p&gt;

&lt;p&gt;As I said earlier, I have tried this is in multiple repos of mine and it’s working fine without any breaking changes. This may seem to be confusing at first, but if you understand the process and read it multiple times you will get familiar.&lt;/p&gt;

&lt;p&gt;If you got any doubts or stuck somewhere, you can contact me.&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>9 useful tricks of git branch you might not know</title>
      <dc:creator>Srebalaji Thirumalai</dc:creator>
      <pubDate>Fri, 14 Aug 2020 07:09:22 +0000</pubDate>
      <link>https://forem.com/srebalaji/9-useful-tricks-of-git-branch-you-might-not-know-4d0e</link>
      <guid>https://forem.com/srebalaji/9-useful-tricks-of-git-branch-you-might-not-know-4d0e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HEBxzzqV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F63a7764f-1370-472f-b106-65e76a57eef9_343x480.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HEBxzzqV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F63a7764f-1370-472f-b106-65e76a57eef9_343x480.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  List all branches that are already merged into a particular branch
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch --merged &amp;lt;respective_branch_name&amp;gt;

Example
git branch --merged master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will help you to find all branches that are already merged with the &lt;strong&gt;master&lt;/strong&gt; branch.&lt;/p&gt;




&lt;h3&gt;
  
  
  Quickly switch to the previous branch
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This will switch to the previous branch you checked out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout @{-1} // checks out to previous branch

git checkout @{-2} // checks out to second previous branch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h3&gt;
  
  
  List all branches ordered by most recent commits
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch --sort=committerdate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will list branches in order of the most recent commits. So you can see branches that you are using it most in recent times.&lt;/p&gt;

&lt;p&gt;Very helpful command and it comes in handy when you are working with multiple branches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VSD0D6L0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fd6cd625f-e41d-4ed2-ac83-033c762d0768_534x207.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VSD0D6L0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fd6cd625f-e41d-4ed2-ac83-033c762d0768_534x207.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above example, &lt;strong&gt;develop&lt;/strong&gt; has the most recent commit. And &lt;strong&gt;master&lt;/strong&gt; has the second most recent commit and so on.&lt;/p&gt;




&lt;h3&gt;
  
  
  Delete local and remote branch
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -d &amp;lt;branch_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This command will delete the branch only if it is merged with the parent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -D &amp;lt;branch_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This command will delete the branch irrespective of whether it is merged or not.&lt;/p&gt;

&lt;p&gt;To delete the branch in remote you can use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin &amp;lt;branch_name&amp;gt; -d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;-d&lt;/strong&gt; attribute will delete the branch in remote too.&lt;/p&gt;




&lt;h3&gt;
  
  
  Showing diff between branches
&lt;/h3&gt;

&lt;p&gt;We have already seen this command in two of our previous issues.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log master..develop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This command will help you show all the commits from &lt;strong&gt;develop&lt;/strong&gt; but that are not present in the master branch. In this way, you can know that how many new commits are added to the develop branch that is not present in the master branch. And make sure you have the updated changes in the local before comparing.&lt;/p&gt;




&lt;h3&gt;
  
  
  Rename a branch name
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -m &amp;lt;old_name&amp;gt; &amp;lt;new_name&amp;gt;

Example
git branch -m development develop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will rename the branch name in local.&lt;/p&gt;

&lt;p&gt;To push the updated branch name to remote,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin :old_name new_name

Example
git push origin :development develop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h3&gt;
  
  
  List remote branches
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This command will list all the local and remote branches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4jEqRNFc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F0fd962cd-e540-4d32-bb69-c3e4e131b1c0_504x266.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4jEqRNFc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252F0fd962cd-e540-4d32-bb69-c3e4e131b1c0_504x266.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To list only the remote branches&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -r
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;These commands will be useful to see which remote branches are still present in local so that you can delete them.&lt;/p&gt;

&lt;p&gt;I mean even after the branch is deleted in remote, there will be a reference to it in the local machine.&lt;/p&gt;

&lt;p&gt;To delete all remote references in local, you can use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote prune origin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h3&gt;
  
  
  List branches containing a particular commit hash
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch --contains &amp;lt;commit-hash&amp;gt;

Example
git branch --contains f9456ba
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will list down all branches that contain a provided commit hash.&lt;/p&gt;

&lt;h3&gt;
  
  
  Show all commits in the current branch yet to be merged to the parent
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git cherry -v &amp;lt;parent_branch&amp;gt;

Example
git cherry -v master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above command will list all commits in the current branch that are yet to be merged to the respective branch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JOViXcdj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fd7599fac-b812-4d2b-962d-12ffc76a100f_807x286.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JOViXcdj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.substack.com/image/fetch/w_1456%2Cc_limit%2Cf_auto%2Cq_auto:good%2Cfl_progressive:steep/https%253A%252F%252Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%252Fpublic%252Fimages%252Fd7599fac-b812-4d2b-962d-12ffc76a100f_807x286.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  This post was originally posted in the newsletter &lt;a href="https://gitbetter.substack.com/"&gt;GitBetter&lt;/a&gt;. If you are interested in leveling up your game in Git, you can subscribe to it.
&lt;/h4&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
