<?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>DEV Community: ls</title>
    <description>The latest articles on DEV Community by ls (@simhskal).</description>
    <link>https://dev.to/simhskal</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%2F61320%2Fdc99b4fb-e9d9-4c64-a321-38dcb2d0d144.jpg</url>
      <title>DEV Community: ls</title>
      <link>https://dev.to/simhskal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/simhskal"/>
    <language>en</language>
    <item>
      <title>Git things: Renaming your working branch</title>
      <dc:creator>ls</dc:creator>
      <pubDate>Sun, 21 May 2023 19:30:37 +0000</pubDate>
      <link>https://dev.to/simhskal/git-things-renaming-your-working-branch-4a05</link>
      <guid>https://dev.to/simhskal/git-things-renaming-your-working-branch-4a05</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I drafted this post years ago and never hit "Publish". :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a developer, I have been working with various proprietary tools for most of my professional life. Recently, I started working on some personal projects where I needed to use Git, an open-source tool for version control. I have to admit, I made silly mistakes while navigating Git at first. But, with some practice and research, I have learned how to use it effectively.&lt;/p&gt;

&lt;p&gt;Something I struggled with initially was renaming a working branch in Git. It's a common task that developers need to do quite often, but I found it challenging initially. After some research and experimentation, I have come up with a goto-guide.&lt;/p&gt;

&lt;p&gt;Here is my step-by-step guide to rename a working branch in Git on both local and remote setups:&lt;/p&gt;

&lt;h2&gt;
  
  
  Renaming a branch locally
&lt;/h2&gt;

&lt;p&gt;First, navigate to the local branch that you want to rename using the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;br&gt;
Then, rename the branch using the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch -m &amp;lt;new-branch-name&amp;gt;&lt;/code&gt;&lt;br&gt;
This will rename the current branch to the new branch name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pushing renamed branch to remote
&lt;/h2&gt;

&lt;p&gt;After renaming the branch locally, push the changes to the remote repository using the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push origin -u &amp;lt;new-branch-name&amp;gt;&lt;/code&gt;&lt;br&gt;
This will push the renamed branch to the remote repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deleting old branch on remote
&lt;/h2&gt;

&lt;p&gt;If you want to delete the old branch from the remote repository, use the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push origin --delete &amp;lt;old-branch-name&amp;gt;&lt;/code&gt;&lt;br&gt;
This will delete the old branch from the remote repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I manage branch renaming with my team members or other contributors?
&lt;/h2&gt;

&lt;p&gt;Here are some things that have really helped me navigate conflicts during branch naming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communicate with your team about the branch renaming and coordinate with members who have branches based on the original branch.&lt;/li&gt;
&lt;li&gt;Merge or rebase changes from affected branches onto the renamed branch. To merge changes from an affected branch onto the renamed branch run 
&lt;code&gt;git merge &amp;lt;affected-branch&amp;gt;&lt;/code&gt;
To rebase the changes from an affected branch onto the renamed branch, you can run:
&lt;code&gt;git rebase &amp;lt;renamed-branch&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Talk through situations where you need a rebase or a merge with your team.&lt;/li&gt;
&lt;li&gt;Update remote branches and repositories by running 
&lt;code&gt;git push -u origin &amp;lt;renamed-branch&amp;gt;&lt;/code&gt;
Ask your team to update changes to their local repositories. 
Once all this gets done, consider removing the old branch to keep this clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it! You have successfully renamed a working branch in Git on both local and remote setups.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>git</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Nevertheless, I Coded</title>
      <dc:creator>ls</dc:creator>
      <pubDate>Wed, 07 Mar 2018 21:54:52 +0000</pubDate>
      <link>https://dev.to/simhskal/nevertheless-lakshmi-subbramanian-coded--3gae</link>
      <guid>https://dev.to/simhskal/nevertheless-lakshmi-subbramanian-coded--3gae</guid>
      <description>&lt;h2&gt;
  
  
  I began/continue to code because...
&lt;/h2&gt;

&lt;p&gt;I wanted to build impactful products with great user experiences.&lt;/p&gt;

&lt;h2&gt;
  
  
  I recently overcame...
&lt;/h2&gt;

&lt;p&gt;Impostor Syndrome. It's intermittent, but real.&lt;/p&gt;

&lt;h2&gt;
  
  
  I want to brag about...
&lt;/h2&gt;

&lt;p&gt;My love for coffee and sneakers, and my passion for yoga.&lt;/p&gt;

&lt;h2&gt;
  
  
  My advice for allies to support women and non-binary folks who code is....
&lt;/h2&gt;

&lt;p&gt;You're here to create and achieve great things. &lt;br&gt;
Use your voice, your strength and win by the hour!&lt;/p&gt;

</description>
      <category>wecoded</category>
    </item>
  </channel>
</rss>
