<?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: Abraham Kamau</title>
    <description>The latest articles on DEV Community by Abraham Kamau (@kirumba).</description>
    <link>https://dev.to/kirumba</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%2F259265%2F4b18f865-2b0e-4e58-b706-6adb862663c2.jpg</url>
      <title>DEV Community: Abraham Kamau</title>
      <link>https://dev.to/kirumba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kirumba"/>
    <language>en</language>
    <item>
      <title>Git Rebase - The easy way</title>
      <dc:creator>Abraham Kamau</dc:creator>
      <pubDate>Thu, 21 Nov 2019 09:57:15 +0000</pubDate>
      <link>https://dev.to/kirumba/git-rebase-the-easy-way-4ape</link>
      <guid>https://dev.to/kirumba/git-rebase-the-easy-way-4ape</guid>
      <description>&lt;p&gt;If you are a software engineer working in a team, then you are probably using git for version control. Imagine working on a certain feature and when your branch is merged to the base branch, everything breaks down because after you checked out from the base branch some changes were pushed to it. Well, there is a basic workflow that can help you avoid all that and make your life easy. This post will take a shallow dive into the process of &lt;code&gt;git rebasing&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is git rebase
&lt;/h2&gt;

&lt;p&gt;Consider a situation where your teammates have made some changes to the master branch since you started working on your feature branch. So you want to get the latest changes so it seems like you have been working on the latest branch. Rebasing gives you the opportunity to merge the master branch with your feature branch while still maintaining a clean history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get to it
&lt;/h2&gt;

&lt;p&gt;I use the following process on a daily basis to get the latest changes from the development branch and resolve conflict.&lt;br&gt;
Key:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;feature-branch - The branch you are working on.&lt;/li&gt;
&lt;li&gt;base-branch - branch you want to merge to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you are on your current working branch,&lt;br&gt;
&lt;strong&gt;Method one:&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 checkout base-branch
- $ git pull origin base-branch
- $ git checkout feature_branch
- $ git rebase base-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Method two:&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 pull --rebase origin base-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Resolve any conflicts you may have&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- $ git add .
- $ git rebase --continue
- $ git push origin branch-name -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As you can see, git rebase is quite an easy process that you can complete in less than a second😃. In just a few simple commands and you have all the latest changes. Stay frosty by using awesome git workflow techniques.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase"&gt;Atlassian&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitlab</category>
    </item>
  </channel>
</rss>
