<?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 Bhupendra Joshi on Medium]]></title>
        <description><![CDATA[Stories by Bhupendra Joshi on Medium]]></description>
        <link>https://medium.com/@bhupendrajoshi?source=rss-cff40901bd16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1aUTuFwWEiPCcQOYhAlT5A@2x.jpeg</url>
            <title>Stories by Bhupendra Joshi on Medium</title>
            <link>https://medium.com/@bhupendrajoshi?source=rss-cff40901bd16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 14:14:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhupendrajoshi/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[A day in the life of a Ruby on Rails app]]></title>
            <link>https://medium.com/@bhupendrajoshi/a-day-in-the-life-of-a-ruby-on-rails-app-2f0e8e3b16da?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f0e8e3b16da</guid>
            <category><![CDATA[rubygems]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Sat, 23 Sep 2017 20:52:09 GMT</pubDate>
            <atom:updated>2017-09-23T21:44:58.384Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a story of a journey of an app from its inception as a ruby on rails app to its functioning as a <a href="http://www.heroku.com/">Heroku</a> app.</p><p>It all started on a terminal of a macOS machine, with getting latest version of <strong>ruby</strong>,</p><pre>\curl -sSL https://get.rvm.io | bash -s stable</pre><p>restarting terminal</p><pre>rvm install ruby-2.4.1</pre><p>then updating gems (as it was already there, to get new see <a href="https://rubygems.org/pages/download">RubyGems</a>)</p><pre>gem update --system</pre><p>then installing the creator of the subject of this story, Rails, together with Postgres the remember of necessary information.</p><pre>gem install rails</pre><pre># Install postgres</pre><pre># Install pg gem<br>gem install &#39;pg&#39;</pre><pre># Install pg OS X driver with homebrew<br>gem install pg -- --with-pg-config=/usr/local/bin/pg_config</pre><blockquote>Creator was there, now it was the turn to bring the <strong>change</strong> to life</blockquote><pre>rails new change --database=postgresql</pre><pre>cd change</pre><pre>bundle install</pre><pre>rails db:create db:migrate</pre><pre>rails s</pre><p>There the <strong>change</strong> was born at <a href="http://localhost:3000/">http://localhost:3000</a>. Change needed to know the people with whom the story would develop, it came in contact with a gem called <a href="https://github.com/plataformatec/devise#starting-with-rails"><strong>devise</strong></a><strong>.</strong></p><blockquote><strong>Devise, </strong>the one who knows to identify people.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38a66c8683cae30455dfec1acdc15b88/href">https://medium.com/media/38a66c8683cae30455dfec1acdc15b88/href</a></iframe><p>Change realized that in today’s world to know more people it has to know <strong>Facebook</strong> and it would be easier to let those people connect to it via Facebook, devise then introduced <a href="https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview"><strong>omniauth</strong></a><strong> </strong>to change.</p><blockquote>With omniauth change could let people connect to it by using Facebook’s <strong>OAuth2 </strong>login mechanism.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaa5e3185982674e59493226b299ee0c/href">https://medium.com/media/eaa5e3185982674e59493226b299ee0c/href</a></iframe><p>At this moment it got facebook integrated inside views that are accessible at <a href="http://localhost:3000/users/sign_in">http://localhost:3000/users/sign_in</a> and <a href="http://localhost:3000/users/sign_up">http://localhost:3000/users/sign_up</a></p><p>But it felt the need to make them accessible from <a href="http://localhost:3000/">http://localhost:3000</a> its home address. Then came the need of a <strong>navbar</strong> that can have links to those pages so that no one needs to remember those links. Thus came <strong>bootstrap</strong> (4 to be precise) which not only would give navbar but also make it possible to style ‘change’s’ home</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fdbf48361fc970d49301d423da76f44a/href">https://medium.com/media/fdbf48361fc970d49301d423da76f44a/href</a></iframe><p>Then came the navbar to allow access to log-in and sign-up under one hood</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4eb4af3b590b8c25f082fbc0518889c7/href">https://medium.com/media/4eb4af3b590b8c25f082fbc0518889c7/href</a></iframe><p>After user signs-in, there is a need to welcome them to the home</p><pre>$ rails generate controller Pages home</pre><pre># Update route in routes.rb<br>root to: &#39;pages#home&#39;</pre><p>Users entering the home from facebook would see their profile pictures but there is no way for the users that created an account using email/pwd. For now, change thought to generate random <strong>gravatar</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5a3028f733033b3a42a9aeafa1327af/href">https://medium.com/media/f5a3028f733033b3a42a9aeafa1327af/href</a></iframe><p>On the way devise told change that putting the facebook app id and secret inside <a href="https://github.com/bhupendrajoshi/registration/commit/d724f77c22254e915f450698a58e39ce25d89e81#diff-a8a4112d0760c0fd11f691c6a5fb22ad">config/initializers/devise.rb</a> directly isn’t a good idea and said <a href="https://github.com/laserlemon/figaro#getting-started"><strong>figaro</strong></a><strong> </strong>can help to keep secret</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6918f08af86a77d0618b0cc03626076/href">https://medium.com/media/b6918f08af86a77d0618b0cc03626076/href</a></iframe><p>Now that change can start making contact, it wished to go out and establish contact with real people, it decided to move to a metropolis, <a href="https://devcenter.heroku.com/articles/getting-started-with-rails5"><strong>Heroku</strong></a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6e8a3bdb0455a2917db1375a609647d/href">https://medium.com/media/c6e8a3bdb0455a2917db1375a609647d/href</a></iframe><p>Change still needed to add facebook app id and secret to Heroku, figaro kept that secret</p><pre>$ figaro heroku:set -e production</pre><pre>if this doesn&#39;t work<br>$ heroku config:set FB_APP_ID=&quot;&lt;APP_ID&gt;&quot;<br>$ heroku config:set FB_APP_SECRET=&quot;&lt;APP_SECRET&gt;&quot;</pre><p>Change is now out in the real world with the help of its creator rails and postgres then with devise, omniauth, gravatar, bootstrap, figaro and eventually Heroku. The change proved to be there with least coding and gems :-)</p><blockquote>But this is only the beginning of the change, it will change every day</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f0e8e3b16da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous integration for Salesforce lightning development]]></title>
            <link>https://medium.com/salesforce-developers/continuous-integration-for-salesforce-lightning-development-a59adf1a21be?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/a59adf1a21be</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[salesforce-tools]]></category>
            <category><![CDATA[salesforce-productivity]]></category>
            <category><![CDATA[lighting-components]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Tue, 21 Mar 2017 19:06:09 GMT</pubDate>
            <atom:updated>2017-03-22T04:57:31.088Z</atom:updated>
            <content:encoded><![CDATA[<p>We were working on building a portal for customer support. To be in line with Salesforce’s vision for future, we decided to build a lightning based community. To build custom lightning components when necessary. This was my first experience with Salesforce customisation and development.</p><p>Since past few years I have been working in continuous integration and continuous deployment practice environments. Automation from end-to-end i.e. from development to deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZX8gXnI-Mt5jzfKszIBcA.png" /><figcaption>Continuous Integration</figcaption></figure><p><strong>Salesforce development</strong> is very different. The development you do resides in the environment itself, in their cloud. So typically you have multiple environments like Development, Test, Production, etc. You do your development in ‘Development’ environment and when you are happy with it you move those changes (via change-sets that is also managed in cloud) to ‘Test’ environment and so forth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*P-esDHGkeI8th38SExXBDw.png" /><figcaption>Typical flow for Salesforce development</figcaption></figure><p>One could argue that the above way is also continuous integration in its own way and to me it is true for integration but not so for continuous. Because creating and deploying those changesets is manual and also testing for lighting community part is manual. You could setup external ways to doing automated tests but still you will need to trigger them and once they run OK trigger the deployment.</p><p>The drawbacks I find with this way for working are,</p><ol><li>No version control</li><li>Change-sets do no guarantee isolated changes (No private workspace)</li><li>Manual testing and deployments</li><li>No rollback</li></ol><p><strong>Continuous integration</strong> is about the ease of development, having a version control for source code, writing automated tests, build server that builds and runs automated tests and a possible post build-test action to deploy to production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ALFxhMDdfrHMPWelQVBGMQ.png" /><figcaption>Continuous Integration with Salesforce Environments</figcaption></figure><p><strong>First step</strong>, doing changes locally on your machine like a developer rather then making changes on the cloud environment. <a href="http://mavensmate.com/">Mavensmate</a> together with <a href="https://atom.io/">Atom</a>. Mavensmate can sync data from Salesforce to local machine and vice-versa. Atom and IDE with mavensmate plugin allows editing the code.</p><p><strong>Second step</strong>, writing automated tests. Writing BDD tests with <a href="https://github.com/cucumber/cucumber-js">Cucumber-BDD</a> + <a href="http://webdriver.io/">Selenium</a>. The tests justify and guard the expectations.</p><p><strong>Third step</strong>, ensuring the custom development and configuration are maintained in source control. With the sources now available locally, it is easy to push to a version control system. I choose <a href="https://github.com/">GitHub</a> to maintain code.</p><p><strong>Fourth step</strong>, running automated tests automatically. Using <a href="https://jenkins.io/">Jenkins</a> server to run the automated tests. Whenever there is a commit pushed to GitHub it send an event on the Jenkins web-hook and that triggers a Jenkins job. Jenkins job runs all the tests and if there is a failure <strong>notifies concerned people</strong>. These tests are run against the sandbox environment where the changes were synced by Mavensmate.</p><p><strong>Fifth step</strong>, deploy if all checks pass. With Ant scripts as Jenkins job post-build step deploy changes to the Salesforce production or another sandbox environment. Only the changes committed to GitHub that triggered the build are deployed, to ensure isolated changes.</p><p><strong>Next steps</strong></p><ul><li>Rollback changes with the help of Ant scripts if and when required.</li><li>Use separate environments for each user-story/bug.</li></ul><p><strong>Salesforce DX</strong></p><p>This is similar to what <a href="https://developer.salesforce.com/platform/dx">Salesforce DX</a> proposes, <em>build together and deliver continuously</em>.</p><p>With scratch-orgs we get isolated environments for development. It will allow us to run our automated tests by hooking up with build pipelines like Heroku pipelines, that will also take care of the deployments.</p><p>The approach mentioned above it flexible and adaptable with DX tools, the systems in the pipeline are interchangeable and have similar way of usage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a59adf1a21be" width="1" height="1" alt=""><hr><p><a href="https://medium.com/salesforce-developers/continuous-integration-for-salesforce-lightning-development-a59adf1a21be">Continuous integration for Salesforce lightning development</a> was originally published in <a href="https://medium.com/salesforce-developers">Salesforce Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with Git — Final]]></title>
            <link>https://medium.com/@bhupendrajoshi/working-with-git-final-9c989ff756fa?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c989ff756fa</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Sat, 04 Mar 2017 19:47:58 GMT</pubDate>
            <atom:updated>2017-03-08T04:31:03.339Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@bhupendrajoshi/working-with-git-67e3c5bf397e#.8vt4fd7cw">Part 1</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-part-2-b99f934e83f0#.wug7wt2j6">Part 2</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-part-3-956a55a90b82#.grmu9ltv3">Part 3</a></p><p><em>Pull request (GitHub, BitBucket) Merge request (GitLab)</em></p><p>Some git implementations like GitHub, BitBucket have a feature that is called pull request. A pull request is a placeholder of all the changes you have on server to be merged into a specific branch. It gives you an overview of changes and allows other members to have a look into those changes like a review and comment on them. It will tell you if the changes are merge-able or there are possible conflicts.</p><p>A pull request has</p><ul><li>Base — this is the branch where you want your changes to go.</li><li>Compare — this is the branch with your changes i.e. branch that has changes that are to be merged</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uU3-JDnZMg8uA-mNmAyhFg.png" /></figure><p><em>Merge</em></p><p>Once you have completed all the necessary checks like code implementation, review, testing you want to get your changes to the master branch and get them released.</p><p>If you have a pull request then you just do this by a click of the button ‘Merge pull request’ but if you do not follow the practice of pull requests then you merge it first locally on your machine and then push the changes to server.</p><p>To do manual merge, lets say we want to merge ‘feature-awesome’ into ‘master’ then we first checkout latest of master then merge feature-awesome into master and push the master branch to server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c989ff756fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with Git — Part 3]]></title>
            <link>https://medium.com/@bhupendrajoshi/working-with-git-part-3-956a55a90b82?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/956a55a90b82</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Sat, 04 Mar 2017 19:47:54 GMT</pubDate>
            <atom:updated>2017-03-08T04:30:51.265Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@bhupendrajoshi/working-with-git-67e3c5bf397e#.8vt4fd7cw">Part 1</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-part-2-b99f934e83f0#.wug7wt2j6">Part 2</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-final-9c989ff756fa#.lwnnu1tmp">Final</a></p><p><em>Pull rebase</em></p><p>Very often there more than one person is working on the same branch. Then it is necessary to keep taking other persons changes to ensure that you are making your changes on top of their changes.</p><p>Suppose in our example other person has made changes (css styling) on our feature and we need to have those to continue further implementation then we need to pull those changes on our local branch. Lets first see how it looks like before we do any local changes, so that means we only do fetch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*jiOa93StwNU5PBVzE8du3g.png" /></figure><p>Here we see that the server version (‘origin/feature-awesome’) of our local branch (‘feature-awesome’) has an additional commit ‘Create awesome.css’. Now we need to get it, we can do it simply by pulling those changes as we do not have any commits or changes that are not on server. After we do a pull it looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*gYdNAwTpBQQbBr4IdHK4Og.png" /></figure><p>Now assume that we had some local commits i.e. some commits that are only done on local repository on branch ‘feature-awesome’ then the original fetch would look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*mVGo-G8sF3ljQDKAVZNeKg.png" /></figure><p>Here we see that the server version of the branch has one additional commit but is missing one commit from our local branch. Here only pulling the changes will not work, this is where we do <em>pull rebase </em>that will allow use to first get all the changes on server and then apply local commits on top of it. Then it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*waNF6fcVxEwQwtfQzdIjiw.png" /></figure><p>See our local commit is now on top of the branch again. It is the head now.</p><p><em>Rebase on another branch</em></p><p>It is about time where we think that the feature implementation is done and we want to get it tested or reviewed, then we want to ensure that we have all the changes of our main branch here it is ‘master’. If you see in the earlier image then we see that the master branch has one commit that our feature branch is missing.</p><p>Most version controls would give you an option to merge the master branch into your branch so that you will get all the missing changes but with git you have an additional option where it allows you to rebase a branch on top of another branch.</p><p>When you rebase your branch on another branch, git will</p><ul><li>Save the commits on your local branch to temporary area</li><li>Get the commits from the other branch to your local branch</li><li>Apply the commits previously saved in temporary area to your branch</li></ul><p>The benefits of this over merging to me are,</p><ul><li>There is no additional commit on your branch</li><li>It allows you to resolve conflicts on the required commit. With merging approach if there are any conflicts then you need to resolve it on that merge commit but with rebase you solve the conflicts on the commits that are saved to temporary area as the conflicts arise when applying them not before.</li></ul><p>So when we rebase our ‘feature-awesome’ branch on ‘master’ branch it looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*gEpYX-pOCS5PA1YUieaVKQ.png" /></figure><p><em>Remove commits</em></p><p>Suppose you have a commit that you do not want to have anymore, it was a temporary commit and no longer required then with git you are remove a particular commit, yes git allows to rewrite history.</p><p>Suppose in our example we want to remove ‘Configuring awesomeness’ the commit as it is no longer needed. We can do that by rebase’ing’ our branch on one commit before the commit (yes we can rebase not only on a branch but also a commit) that is not required but this time doing interactive rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*LC1PsQ1T-jTtvTgNc85BfQ.png" /></figure><p>Then when rebasing choose interactive rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-qCiX7hSgFdBEVwEbkWBA.png" /></figure><p>Then click rebase. You will be presented with an editor or a window that will show you the commits that will be rebased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSPm2T3aWBd7q1YAxmYC_Q.png" /></figure><p>From this window you can remove the commit that is no longer required, save and close that window to continue rebase.</p><p>After rebase is complete that commit will disappear (it is still on the server as we have not pushed the branch yet)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*XXE8w_XIjkM7fldVEn7zYg.png" /></figure><p><em>Squash commits</em></p><p>When you working with multiple people on one branch in order to communicate your changes to each other you commit often but before you send it out to review or test or merging in the main branch you do not need all those small separate commits. With git you can squash two or more commits into one commit and also re-write the commit message to make your intention clear.</p><p>As we did before to remove commits an interactive rebase, to squash commits (which is also a history re-write operation) we do an interactive rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*HZbNOMufqBZZF1lxqusQ8w.png" /></figure><p>There are two ways to squash commits,</p><ul><li>Squash and reuse exiting commit message, operation s</li><li>Squash but change the commit message, operation f</li></ul><p>In the above window, lets say we want to squash all the commits in one commit and also change the commit message we prefix all but the first commit (as we need at least one commit for the changes) with ‘f’ or ‘fixup’ instead of ‘pick’ and for the first commit say ‘r’ or ‘reword’. Save the window and continue. It will show another window where you are see the first commit’s commit message and you can change it by new commit message like ‘Feature awesomeness complete’ and continue rebase. Now it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*nSu63wy-PPYGtVIcHbyRng.png" /></figure><p>Now we push our changes to the server so that review, builds and test can proceed. Only this time git will tell you that there are changes on server that are not locally because,</p><ul><li>Either someone else added new commit on the same branch then you need to first do pull-rebase.</li></ul><p>OR</p><ul><li>There were no new changes on the server but as we re-wrote the history by rebaseing on different branch, removing commits, squashing commits, changing commit message, that now commits of the server pulled earlier do not match with the commit on the server. So now we do a <em>‘force push’</em> instead. Force push will re-write the branch on server. Just be cautious and check with others on your team about the force push to ensure you do not overwrite any commits in transit.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*Ry6nl-n8QXLo0E69N17ruw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=956a55a90b82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with Git — Part 2]]></title>
            <link>https://medium.com/@bhupendrajoshi/working-with-git-part-2-b99f934e83f0?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/b99f934e83f0</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Sat, 04 Mar 2017 19:47:49 GMT</pubDate>
            <atom:updated>2017-03-08T04:30:41.775Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@bhupendrajoshi/working-with-git-67e3c5bf397e#.8vt4fd7cw">Part 1</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-part-3-956a55a90b82#.grmu9ltv3">Part 3</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-final-9c989ff756fa#.lwnnu1tmp">Final</a></p><p><strong>Making changes</strong></p><p>Once you have created your branch you start making changes to the files i.e. start implementing your feature or fixing the bug.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJNT2lYE0V0K1653sg_CYw.png" /></figure><p><em>Commit</em></p><p>Make sure you are committing regularly, when you commit you are making changes to your local branch on your local repository. This is important when there is more than one person contributing to the development on the same branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*p2Y6ZqCAJLq5xbOHO3Z2PQ.png" /></figure><p><em>Push</em></p><p>To make your changes available to other team members, it is important to push your changes. By pushing the changes you send the commits to server. Now other team members can get latest of the branch and continue working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*OkK2F6G8fsJHvtpOhNvjvQ.png" /></figure><p><em>Fetch</em></p><p>When you are working you make sure that every day you have the latest code and then you work from there. With Git being distributed version control system you not only need to know latest on your local repository but also the server repository. For this Git has something called fetch.</p><p>To know what is latest on the server repository you do <em>“fetch”</em>, this shows you the current status of all branches on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*J-Ue-ABK5t4UjZJhs07dew.png" /></figure><p><em>Pull</em></p><p>With fetch you know the changes that are on server but not on your local repository yet. To get the changes on your local copy of the branch you need to pull the changes. Pull will first do <em>‘fetch’</em> and then apply the commits of the pulled branch on the branch tracked to your local repository. If the branch does not exist locally it will create the branch and establish tracking for future references.</p><p>From the above image we see our local ‘master’ branch is not in sync with server ‘origin/master’ branch. So we checkout master and then pull from origin i.e. server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*GYUmIbe_VM6fbHHd-w75NQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b99f934e83f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with Git — Part 1]]></title>
            <link>https://medium.com/@bhupendrajoshi/working-with-git-67e3c5bf397e?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/67e3c5bf397e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[version-control]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Sat, 04 Mar 2017 19:43:39 GMT</pubDate>
            <atom:updated>2017-03-08T04:30:30.594Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@bhupendrajoshi/working-with-git-part-2-b99f934e83f0#.wug7wt2j6">Part 2</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-part-3-956a55a90b82#.grmu9ltv3">Part 3</a>, <a href="https://medium.com/@bhupendrajoshi/working-with-git-final-9c989ff756fa#.lwnnu1tmp">Final</a></p><p><strong>Repository</strong></p><p>Like with most version control systems the first thing you do is, either create a repository or get an existing repository.</p><p><em>Create a repository</em></p><p>Create a Git repository locally by executing ‘<em>git init</em>’ command OR via GUI OR you can create Git repository on server like (GitHub, BitBucket, GitLab, etc) and clone it locally.</p><p><em>Get an existing repository</em></p><p>Using command line go to the directory you wish to clone the repository type:</p><blockquote>git clone &lt;git repo url.git&gt;</blockquote><p>Using GitExtensions click on Clone Repository and then use your Git repository URL of the server and clone it locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyw4Pc-I8fSVTRm8J_JmGQ.png" /></figure><p><em>How to differentiate what is local and what is server’s?</em></p><p>Most Git GUIs will show the branch name on the commit, when there is no prefix to the branch like ‘origin/’ you know that it is your local repository. The prefix is to show an external path. These are called as remote paths and can be updated in remote repositories section. When you clone an existing repository or do your first push of a new repository, the tracking between local and server repository is established. By default the server repository is denoted by ‘origin’ however it can be changed to whatever you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*bwgpkG1tIQGGYb4uD0gVEQ.png" /></figure><p>In the above image ‘master’ is local and ‘origin/master’ is remote (server).</p><p><strong>Branching</strong></p><p>One of the most important part of having a version control system is doing your changes in isolation. Making sure it works and passes integration and only then getting it in to a release of a product. For this, version control systems provide a mechanism which is called branching, via which you get a branch. A branch is is a copy of a section of your repository i.e. copy of commits.</p><p>In Git you are always working on a branch whether it is main (master) branch or feature branch. In Git you create a branch from another branch, the source is then called as parent branch.</p><p>A Git repository starts with a ‘master’ branch. When you start development you do not directly make changes on your master branch, that branch is suppose to be stable always, pointing to latest released. Instead you create a branch from your stable branch and you make your changes there.</p><p>You create a branch by right clicking on the parent and then say create branch. If for any reason you have started working on your source branch, but while committing you realize that you should have created a new branch then it is OK, you can create a branch with your current uncommitted changes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67e3c5bf397e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with Git]]></title>
            <link>https://medium.com/series/working-with-git-b9060faeb12c?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9060faeb12c</guid>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Sat, 04 Mar 2017 19:40:40 GMT</pubDate>
            <atom:updated>2017-03-04T19:40:40.496Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Repository</strong></p><p>Like with most version control systems the first thing you do is either create a repository or get an existing repository.</p><p><em>Create a repository</em></p><p>Create a git repository locally by executing ‘<em>git init</em>’ command or via GUI OR you can create git repository on server like (GitHub, BitBucket, GitLab, etc) and clone it locally.</p><p><em>Get an existing repository</em></p><p>From command line in the directory you wish to clone the repository type</p><blockquote>git clone &lt;git repo url.git&gt;</blockquote><p>Using GitExtensions click on Clone Repository and then use your git repository URL of the server and clone it locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyw4Pc-I8fSVTRm8J_JmGQ.png" /></figure><p><em>How to differentiate what is local and what is server?</em></p><p>Most Git GUIs will show the branch name on the commit, when there is no prefix to the branch like ‘origin/’ you know that is your local repository. The prefix is show external path. These are called as remote paths and can be updated in remote repositories section. When you clone an existing repository or do your first push of a new repository the tracking between local and serer repository is established. By default the server repository is denoted by ‘origin’ however it can be changed to whatever you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*bwgpkG1tIQGGYb4uD0gVEQ.png" /></figure><p>In the above image ‘master’ is local and ‘origin/master’ is remote (server).</p><p><strong>Branching</strong></p><p>One of the most important part of having a version control system is doing your changes in isolation, making sure it works and passes integration and only then getting it in to a release of a product. For this version control systems provide a mechanism which is called branching, via which you get a branch. A branch is is a copy of a section of your repository i.e. copy of commits.</p><p>In git you are always working on a branch whether it is main (master) branch or feature branch. In git you create a branch from another branch, the source is then called as parent branch.</p><p>A git repository starts with a ‘master’ branch. When you start development you do not directly make changes on your master branch, that branch is suppose to be stable always, pointing to latest released. Instead you create a branch from your stable branch and you make your changes there.</p><p>You create a branch by right clicking on the parent and then say create branch. If for any reason you starting working on your source branch but while committing you realize that you should have created a new branch then it is OK you can create a branch with your current uncommitted changes.</p><p><strong>Making changes</strong></p><p>Once you have created your branch you start making changes to the files i.e. start implementing your feature or fixing the bug.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJNT2lYE0V0K1653sg_CYw.png" /></figure><p><em>Commit</em></p><p>Make sure you are committing regularly, when you commit you are making changes to your local branch on your local repository. This is important once you are more than one person contributing to the development on the same branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*p2Y6ZqCAJLq5xbOHO3Z2PQ.png" /></figure><p><em>Push</em></p><p>Then it is also important to keep pushing your changes to the server so that the other person can take your changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*OkK2F6G8fsJHvtpOhNvjvQ.png" /></figure><p><em>Fetch</em></p><p>When you are working you make sure that every day you have the latest code and then you work from there. With git being distributed version control system you not only need to know latest on your local repository but also on the server repository. For this git has something called fetch.</p><p>To know what is latest on the server repository you do git fetch, this shows you the current status of all branches on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*J-Ue-ABK5t4UjZJhs07dew.png" /></figure><p><em>Pull</em></p><p>To get the latest from server for a branch on same branch on your local repository you need to pull the changes. Pull will first do ‘fetch’ and then apply the commits of the pulled branch on the branch tracked to your local branch. If the branch does not exist locally it will create the branch and establish tracking for future references.</p><p>From the above image we see our local ‘master’ branch is not in sync with server ‘origin/master’ branch. So we checkout master and then pull from origin i.e. server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*GYUmIbe_VM6fbHHd-w75NQ.png" /></figure><p><em>Pull rebase</em></p><p>Very often there more than one person is working on the same branch. Then it is necessary to keep taking other persons changes to ensure that you are making your changes on top of their changes.</p><p>Suppose in our example other person has made changes (css styling) on our feature and we need to have those to continue further implementation then we need to pull those changes on our local branch. Lets first see how it looks like before we do any local changes, so that means we only do fetch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*jiOa93StwNU5PBVzE8du3g.png" /></figure><p>Here we see that the server version (‘origin/feature-awesome’) of our local branch (‘feature-awesome’) has an additional commit ‘Create awesome.css’. Now we need to get it, we can do it simply by pulling those changes as we do not have any commits or changes that are not on server. After we do a pull it looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*gYdNAwTpBQQbBr4IdHK4Og.png" /></figure><p>Now assume that we had some local commits i.e. some commits that are only done on local repository on branch ‘feature-awesome’ then the original fetch would look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*mVGo-G8sF3ljQDKAVZNeKg.png" /></figure><p>Here we see that the server version of the branch has one additional commit but is missing one commit from our local branch. Here only pulling the changes will not work, this is where we do <em>pull rebase </em>that will allow use to first get all the changes on server and then apply local commits on top of it. Then it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*waNF6fcVxEwQwtfQzdIjiw.png" /></figure><p>See our local commit is now on top of the branch again. It is the head now.</p><p><em>Rebase on another branch</em></p><p>It is about time where we think that the feature implementation is done and we want to get it tested or reviewed, then we want to ensure that we have all the changes of our main branch here it is ‘master’. If you see in the earlier image then we see that the master branch has one commit that our feature branch is missing.</p><p>Most version controls would give you an option to merge the master branch into your branch so that you will get all the missing changes but with git you have an additional option where it allows you to rebase a branch on top of another branch.</p><p>When you rebase your branch on another branch, git will</p><ul><li>Save the commits on your local branch to temporary area</li><li>Get the commits from the other branch to your local branch</li><li>Apply the commits previously saved in temporary area to your branch</li></ul><p>The benefits of this over merging to me are,</p><ul><li>There is no additional commit on your branch</li><li>It allows you to resolve conflicts on the required commit. With merging approach if there are any conflicts then you need to resolve it on that merge commit but with rebase you solve the conflicts on the commits that are saved to temporary area as the conflicts arise when applying them not before.</li></ul><p>So when we rebase our ‘feature-awesome’ branch on ‘master’ branch it looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*gEpYX-pOCS5PA1YUieaVKQ.png" /></figure><p><em>Remove commits</em></p><p>Suppose you have a commit that you do not want to have anymore, it was a temporary commit and no longer required then with git you are remove a particular commit, yes git allows to rewrite history.</p><p>Suppose in our example we want to remove ‘Configuring awesomeness’ the commit as it is no longer needed. We can do that by rebase’ing’ our branch on one commit before the commit (yes we can rebase not only on a branch but also a commit) that is not required but this time doing interactive rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*LC1PsQ1T-jTtvTgNc85BfQ.png" /></figure><p>Then when rebasing choose interactive rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-qCiX7hSgFdBEVwEbkWBA.png" /></figure><p>Then click rebase. You will be presented with an editor or a window that will show you the commits that will be rebased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSPm2T3aWBd7q1YAxmYC_Q.png" /></figure><p>From this window you can remove the commit that is no longer required, save and close that window to continue rebase.</p><p>After rebase is complete that commit will disappear (it is still on the server as we have not pushed the branch yet)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*XXE8w_XIjkM7fldVEn7zYg.png" /></figure><p><em>Squash commits</em></p><p>When you working with multiple people on one branch in order to communicate your changes to each other you commit often but before you send it out to review or test or merging in the main branch you do not need all those small separate commits. With git you can squash two or more commits into one commit and also re-write the commit message to make your intention clear.</p><p>As we did before to remove commits an interactive rebase, to squash commits (which is also a history re-write operation) we do an interactive rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*HZbNOMufqBZZF1lxqusQ8w.png" /></figure><p>There are two ways to squash commits,</p><ul><li>Squash and reuse exiting commit message, operation s</li><li>Squash but change the commit message, operation f</li></ul><p>In the above window, lets say we want to squash all the commits in one commit and also change the commit message we prefix all but the first commit (as we need at least one commit for the changes) with ‘f’ or ‘fixup’ instead of ‘pick’ and for the first commit say ‘r’ or ‘reword’. Save the window and continue. It will show another window where you are see the first commit’s commit message and you can change it by new commit message like ‘Feature awesomeness complete’ and continue rebase. Now it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*nSu63wy-PPYGtVIcHbyRng.png" /></figure><p>Now we push our changes to the server so that review, builds and test can proceed. Only this time git will tell you that there are changes on server that are not locally because,</p><ul><li>Either someone else added new commit on the same branch then you need to first do pull-rebase.</li></ul><p>OR</p><ul><li>There were no new changes on the server but as we re-wrote the history by rebaseing on different branch, removing commits, squashing commits, changing commit message, that now commits of the server pulled earlier do not match with the commit on the server. So now we do a <em>‘force push’</em> instead. Force push will re-write the branch on server. Just be cautious and check with others on your team about the force push to ensure you do not overwrite any commits in transit.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*Ry6nl-n8QXLo0E69N17ruw.png" /></figure><p><em>Pull request (GitHub, BitBucket) Merge request (GitLab)</em></p><p>Some git implementations like GitHub, BitBucket have a feature that is called pull request. A pull request is a placeholder of all the changes you have on server to be merged into a specific branch. It gives you an overview of changes and allows other members to have a look into those changes like a review and comment on them. It will tell you if the changes are merge-able or there are possible conflicts.</p><p>A pull request has</p><ul><li>Base — this is the branch where you want your changes to go.</li><li>Compare — this is the branch with your changes i.e. branch that has changes that are to be merged</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uU3-JDnZMg8uA-mNmAyhFg.png" /></figure><p><em>Merge</em></p><p>Once you have completed all the necessary checks like code implementation, review, testing you want to get your changes to the master branch and get them released.</p><p>If you have a pull request then you just do this by a click of the button ‘Merge pull request’ but if you do not follow the practice of pull requests then you merge it first locally on your machine and then push the changes to server.</p><p>To do manual merge, lets say we want to merge ‘feature-awesome’ into ‘master’ then we first checkout latest of master then merge feature-awesome into master and push the master branch to server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9060faeb12c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thinking in Git]]></title>
            <link>https://medium.com/@bhupendrajoshi/thing-about-git-ac15ae427cc8?source=rss-cff40901bd16------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac15ae427cc8</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Bhupendra Joshi]]></dc:creator>
            <pubDate>Thu, 02 Mar 2017 21:07:51 GMT</pubDate>
            <atom:updated>2017-03-08T04:29:14.375Z</atom:updated>
            <content:encoded><![CDATA[<p>Much has been written, spoken, shoved down the throat about Git. The challenge I have faced, while talking to people about Git is that many suffer from the jargon Git brings with it.</p><p>They hide behind the phrase:</p><blockquote>“steep learning curve.”</blockquote><p>This is my attempt to find a way to make Git easier to learn and make one hands on with it quicker.</p><p>Git is a distributed version control system. It allows group of people to work on the same code (files), without stepping on each other’s toes.</p><p><strong>What is a version control?</strong></p><p>You are working on a product that is a solution to world class problem. You make this awesome app. You manage to make it work with 3 files. It is working fine you release it. It is just three files you can handle it.</p><p>Now you are working on a new feature that changes one of the 3 files. However in the meantime you have a critical issue to fix, and that changes the same file. So you juggle adding a new feature and fixing a critical issue. So what do you do?</p><p>Simple, it is just 3 files, then:</p><ul><li>make a copy of the files in another directory</li><li>fix the bug</li><li>re-release the application.</li></ul><p>But now imagine you need to manage an application with hundreds of files or more. It become tedious and soon unmanageable to keep track of the changes. More people contributing to the changes it turns more problematic. That’s why we need version control systems, for collaboration and versioning.</p><p>Version control systems records changes to a file or set of files over time so that you can recall specific versions later. It keeps track of every modification to the file. If a mistake is made, you can compare with earlier versions or bring back older version while minimizing disruption to all team members.</p><p><strong>About Git</strong></p><p>As you learn Git, try to clear your mind of the things, you may know about other VCSs, such as Subversion and Perforce; doing so will help you avoid subtle confusion when using the tool. Git stores and thinks about information much differently than these other systems, even though the user interface is fairly similar. Understanding those differences will help prevent you from becoming confused while using it.</p><p><strong>Repository</strong></p><p>The purpose of Git is to manage a project, or a set of files, as they change over time. Git stores this information in a data structure called a repository.</p><p><strong>Storing snapshots (making it fast)</strong></p><p>The major difference between Git and and other VCSs is in the way it thinks about its data. Other VCSs like SVN, TFS store deltas i.e. they store only the changes in next revisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*DwY7yroRxRMvJIHRw9J5qg.png" /><figcaption>Deltas</figcaption></figure><p>In the above image observe that in the version 2 when File A was modified it will only store the changes done on File A in version 2.</p><p>Git on the other hand store the modified copy of the complete file when the file is changed, more like a snapshot of the file. This makes most Git operations quick like creating a branch, getting latest (as it does not have to drill further and further to get one file), etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*Ttux7BGzjcfTXHTHJ6Sk1w.png" /><figcaption>Snapshots</figcaption></figure><p>In the above image observe that when File A is modified it will keep the complete modified file in Version 2.</p><p><strong>Ease of undo-redo</strong></p><p>Almost every operation you do is an add operation to a Git repository, this means with regular commits it is very difficult to get the system to do anything that is not undo-able. It makes it easy to experiment and it is easy to recover previous version. Also as almost every operation you do on a Git repository is local (done on the local copy of the repository) it makes it easier to not publish any changes until you are happy with it.</p><p><strong>Repository and what you can do with it?</strong></p><p>Repository is a place where history of your work is stored, all your commits (check-ins), branches, tags (labels).</p><p>How do you get a repository?</p><p><strong><em>Create one</em></strong></p><p>When you are starting with a new project and want to setup version control using Git, then you create your repository.</p><p>You do that by typing <em>‘git init’</em> on the command line inside a directory that becomes your repository.</p><p><strong><em>Clone one</em></strong></p><p>When you are joining in on an existing project which, already has a Git repository on a Git server somewhere (like GitHub, BitBucket, GitLab, etc.) you clone that repository locally (i.e. make a copy of it on your local machine).</p><p>You do that by getting a clone url of the repository (look at server url of the repository usually ending with .git) then type in the concerned directory,</p><blockquote>git clone &lt;git repository url ending with .git&gt;</blockquote><p>What happens when you have a Git repository locally?</p><p>Once you have cloned or created a repository locally you see you have a .git folder, this is where your repository is in a compressed format.</p><p><strong>Git workflow</strong></p><p>Normally when you are working with Git or for that matter any version control system, you work on a branch (a copy of your latest stable version).</p><p>Your path is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aso3tid0by5lRfUO0lm5ZQ.png" /><figcaption>Git workflow</figcaption></figure><p><em>How Git does it?</em></p><p>Files in a Git repository can be in 3 states, committed, modified and staged.</p><ul><li>Committed means that the data is safely stored in your local database.</li><li>Modified means that you have changed the file but have not committed it to your database yet.</li><li>Staged means that you have marked a modified file in its current version to go into your next commit.</li></ul><p>A local Git repository has following 3 states</p><ol><li>Working directory</li></ol><ul><li>Single checkout of one version of the project. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.</li><li>You modify your files here.</li></ul><p>2. Staging area (index)</p><ul><li>Generally contained in your Git directory, that stores information about what will go into your next commit. It’s sometimes referred to as the “index”, but it’s also common to refer to it as the staging area.</li><li>Files selected to go in next commit snapshot.</li></ul><p>3. Repository (.git directory)</p><ul><li>.git directory is where Git stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you clone a repository from another computer.</li><li>Files from staging area that are committed.</li></ul><p>In normal day to day process you do not often stage files and keep it there for long, because you modify files, ensure to commit them regularly and continue working.</p><p>You push to the server only when you are happy with the changes or you need someone else (working on the same branch)to have your changes. Making commits often on your local repository is fine, because with Git you can later rearrange your commits and/or squash (merge) them. When you start with Git this can be helpful until you get a hang of the whole Git workflow.</p><p><strong>Git GUIs</strong></p><p>While working with Git it is important to:</p><ul><li>Keep track of the branch you are working on</li><li>Keeping your current branch up to date.</li><li>Knowing what is on the server’s copy of the branch and what is on the local copy of the branch.</li></ul><p>Doing it seamlessly becomes a tough task.</p><p>Although almost all operations on a Git repository are reversible. Command line for Git operations, can become very confusing especially when there are multiple people on single Git repository and it is growing fast.</p><p>There are some GUIs that shows you the overview and provide simpler menu options for operations. Such as:</p><ol><li>Git Extensions : Gives a nice overview of your repository, what is on server and what is locally, your current working branch, your changes, simple operations (commit, push, pull, rebase, etc.).</li><li>SourceTree</li><li>Git Kraken</li><li>GitHub for Windows</li></ol><p>This is a simpler overview of how Git works and how one can use Git for collaboration and versioning.</p><p>Click here if you want to know more about <a href="https://medium.com/@bhupendrajoshi/working-with-git-67e3c5bf397e#.g84kgn1op">Working with Git</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac15ae427cc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>