<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sayan Chowdhury on Medium]]></title>
        <description><![CDATA[Stories by Sayan Chowdhury on Medium]]></description>
        <link>https://medium.com/@yudocaa?source=rss-82888ff208b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0s6AB7lgDBoErBzras7xmQ.jpeg</url>
            <title>Stories by Sayan Chowdhury on Medium</title>
            <link>https://medium.com/@yudocaa?source=rss-82888ff208b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 16:21:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yudocaa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Force Git to use git:// instead of https://]]></title>
            <link>https://medium.com/@yudocaa/force-git-to-use-git-instead-of-https-b0e00a1b6898?source=rss-82888ff208b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0e00a1b6898</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Sayan Chowdhury]]></dc:creator>
            <pubDate>Thu, 29 Aug 2019 09:56:40 GMT</pubDate>
            <atom:updated>2019-08-29T10:00:52.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6XeL5ZKVBpwwZlqHp-Isw.jpeg" /></figure><p>I’m an advocate of using SSH authentication and connecting to services like Github, Gitlab, and many others. I do make sure that the use the git:// URL while cloning the repo but sometimes I do make mistake of using the https:// instead. Only to later realise when git prompts me to enter my username to authenticate the SSH connection. This is when I have to manually reset my git remote URL.</p><p>Today, I found a cleaner solution to this problem. I can use insteadOf to enforce the connection via SSH.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/443425f10ad15c3255acf0ffea10c551/href">https://medium.com/media/443425f10ad15c3255acf0ffea10c551/href</a></iframe><p>This creates an entry in your .gitconfig:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/885f57144c30a2d3be1a8801d37f7153/href">https://medium.com/media/885f57144c30a2d3be1a8801d37f7153/href</a></iframe><p>Photo by <a href="https://unsplash.com/@yancymin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Yancy Min</a> on <a href="https://unsplash.com/@yancymin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0e00a1b6898" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Editing Git commits from history]]></title>
            <link>https://medium.com/@yudocaa/editing-git-commits-from-history-19562de3e6d0?source=rss-82888ff208b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/19562de3e6d0</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gitflow]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Sayan Chowdhury]]></dc:creator>
            <pubDate>Mon, 04 Feb 2019 17:40:46 GMT</pubDate>
            <atom:updated>2019-02-05T06:13:49.667Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wbyt0LQu7AMfd0E-yplFMg.jpeg" /></figure><p>Let’s say you’ve raised a Pull Request on GitHub with 3 commits as shown below.</p><pre>d46d2f8a (HEAD -&gt; feature, devel/feature) Add Fedora system to handle the Fedora Cloud images<br>f726b033 vendor: Add new dep github.com/ulikunitz/xz<br>dbdbda67 Split release and pre-release to handle multiple systems</pre><p>Here, d46d2f8a is the <strong>HEAD, </strong>followed by<strong> </strong>f726b033 and dbdbda67.</p><p>Your reviewers go through the commits, and suggest changes to some files. The suggestions now need to be applied to the commit dbdbda67. How would you fix this? This is a jam I usually land myself in, as for review I prefer my commits to be concise, shows incremental changes and for each commit to be atomic.</p><p>There are two ways you can use to fix this issue:</p><h3>Rebase and Edit</h3><p>I start off with git rebase -i which opens up the list of commits up for rebase. In our example here, the third commit from the HEAD needs to be changed, so I&#39;ll rebase commits till HEAD~3.</p><pre>git rebase -i HEAD~3</pre><p>This opens up the editor, with the options</p><pre>pick dbdbda67 Split release and pre-release to handle multiple systems<br>pick f726b033 vendor: Add new dep github.com/ulikunitz/xz<br>pick d46d2f8a Add Fedora system to handle the Fedora Cloud images</pre><p>Below this, you will find a list of commands you can use with git-rebase:</p><pre># p, pick &lt;commit&gt; = use commit<br># r, reword &lt;commit&gt; = use commit, but edit the commit message<br># e, edit &lt;commit&gt; = use commit, but stop for amending<br># s, squash &lt;commit&gt; = use commit, but meld into previous commit<br># f, fixup &lt;commit&gt; = like &quot;squash&quot;, but discard this commit&#39;s log message<br># x, exec &lt;command&gt; = run command (the rest of the line) using shell<br># d, drop &lt;commit&gt; = remove commit<br># l, label &lt;label&gt; = label current HEAD with a name<br># t, reset &lt;label&gt; = reset HEAD to a label<br># m, merge [-C &lt;commit&gt; | -c &lt;commit&gt;] &lt;label&gt; [# &lt;oneline&gt;]<br># .       create a merge commit using the original merge commit&#39;s<br># .       message (or the oneline, if no original merge commit was<br># .       specified). Use -c &lt;commit&gt; to reword the commit message.</pre><p>The list is quite coherent, but for this post, we’ll use the edit command. So replace pickwith edit against the commit, you would like to edit and exit the editor.</p><p>So for our example, it’ll become (note the edit command in the first line):</p><pre>edit dbdbda67 Split release and pre-release to handle multiple systems<br>pick f726b033 vendor: Add new dep github.com/ulikunitz/xz<br>pick d46d2f8a Add Fedora system to handle the Fedora Cloud images</pre><pre># Rebase 51c8dc75..d46d2f8a onto 51c8dc75 (3 commands)<br>#<br># Commands:<br># p, pick &lt;commit&gt; = use commit<br># r, reword &lt;commit&gt; = use commit, but edit the commit message<br># e, edit &lt;commit&gt; = use commit, but stop for amending<br># s, squash &lt;commit&gt; = use commit, but meld into previous commit<br># f, fixup &lt;commit&gt; = like &quot;squash&quot;, but discard this commit&#39;s log message<br># x, exec &lt;command&gt; = run command (the rest of the line) using shell<br># d, drop &lt;commit&gt; = remove commit<br># l, label &lt;label&gt; = label current HEAD with a name<br># t, reset &lt;label&gt; = reset HEAD to a label<br># m, merge [-C &lt;commit&gt; | -c &lt;commit&gt;] &lt;label&gt; [# &lt;oneline&gt;]<br># .       create a merge commit using the original merge commit&#39;s<br># .       message (or the oneline, if no original merge commit was<br># .       specified). Use -c &lt;commit&gt; to reword the commit message.<br>#<br># These lines can be re-ordered; they are executed from top to bottom.<br>#<br># If you remove a line here THAT COMMIT WILL BE LOST.<br>#<br>#       However, if you remove everything, the rebase will be aborted.<br>#<br>#<br># Note that empty commits are commented out</pre><p>What this will do is stop the rebase process at the commit you wanted to edit. At this moment, you can go ahead and perform your changes. Add files, modify them, remove them etc.</p><p>Once you’re done, add the files using git add and continue the rebase using:</p><pre>git rebase --continue</pre><h3>The other way? Rebase and Fixup</h3><p>I’ve recently started to use this method a whole lot more than the previous one I described. Here, you can just go ahead and do the changes.</p><p>Once done, pass the argument --fixup, while making the commit. For our example,</p><pre>git commit --fixup=dbdbda67</pre><p>This would create a fixup commit starting with !fixup. Next, go ahead and rebase the commits from the commit to be fixed to fixup commit.</p><pre>git rebase -i --autosquash dbdbda67~1</pre><p>This will merge the fixup commit with the commit to be fixed.</p><p>Voila! Serve the PR while hot. 🍜</p><p>Do you know easier methods to tackle this issue? Drop me a message on Twitter <a href="https://twitter.com/yudocaa">@yudocaa</a>. I would like to thank <a href="https://twitter.com/jasonbraganza">Jason</a>, <a href="https://twitter.com/Jaysinhp">Jaysinh</a>, and <a href="https://twitter.com/sayani0_0">Sayani</a> who did proofreading for this blog post. Thanks to <a href="https://unsplash.com/@anniespratt">@anniespratt</a> for the cover image.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19562de3e6d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vim, Wish I knew this about you before!]]></title>
            <link>https://medium.com/@yudocaa/vim-wish-i-knew-this-about-you-before-47289f577fe4?source=rss-82888ff208b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/47289f577fe4</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[editor]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Sayan Chowdhury]]></dc:creator>
            <pubDate>Thu, 24 Jan 2019 10:43:00 GMT</pubDate>
            <atom:updated>2019-01-24T10:43:00.934Z</atom:updated>
            <content:encoded><![CDATA[<p>Almost all my life since I have started working around open source projects I have been a Vim user. That does not mean that I did not look into other options. I’ve tried my hands on Emacs, Sublime Text, Visual Studio Code, Atom, et cetera. But, none of them pleased me like vim.</p><p>2018, I started working on Golang, and vim had to adapt to my needs, but it did not quite succeed and I made my switch to neovim around the end of the year. Around the same time, I took a resolution to dive deep into neovim to increase my productivity.</p><h3>Jump Lists</h3><p>In golang, I heavily use a :GoDef which is part of the <a href="https://github.com/fatih/vim-go">vim-go</a> plugin to go to a specific symbol or declaration.</p><p>Vim keeps track of all the jumps (previously visited cursor positions). :jumps lists down all the performed jumps for the current window. Ctrl+O &amp; Ctrl+I helps you to cycle through the jumps. But, what counts as a jump?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*6uRvwb05pLvZzoEeBbRqjA.jpeg" /></figure><p>Any of the actions mentioned on the above list counts as a jump and makes an entry into the jump list. You can clear the jump list using :clearjumps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jC7FEbaNOeiezu5fYwMCAw.png" /></figure><p>The columns being jump, line, column and file/text. Given the above:</p><ul><li>Ctrl-I to jump to line 415 in the current buffer.</li><li>Ctrl-O to jump to line 358 in the current buffer.</li><li>3 then Ctrl-O to jump to line 364 in the current buffer.</li><li>5 then Ctrl-I to jump to line 395 in the mantle/cmd/plume/prerelease.go.</li></ul><p><em>I’ll keep on updating the posts as I learn more about vim/neovim. Till then, saraba da!</em></p><p><em>Reference for this post:</em></p><ul><li><a href="http://vim.wikia.com/wiki/Jumping_to_previously_visited_locations"><em>Jumping to previously visited locations</em></a></li><li><a href="https://medium.com/@kadek/understanding-vims-jump-list-7e1bfc72cdf0"><em>Understanding Vim’s Jump List</em></a></li></ul><p><em>I cross posted this post on my personal blog </em><a href="https://words.yudocaa.in/"><em>Intellectual Web</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47289f577fe4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>