Tuesday, May 8, 2018

Productivity Tips: Git merge

If some rather mindless activity takes 20 minutes out of your day on most days, it’s a big deal. That's two weeks in a given year you would rather spend in Hawaii. For a medium-size team, improving the productivity to save these 20 minutes is like hiring one more developer.

Efficient Git merge

I am still new to Git, and I am really liking it. The workflow I learnt from tutorials was to create a local master branch and another local branch for a pull request. To get new changes or resolve conflicts, you switch to the local maser branch, pull it, switch to the other branch, and merge from the local master branch.

The problem here is that Visual Studio reloads the solution when you switch branches. For the solution with ~100 projects, it took up to 3 minutes, times two as you need to switch back to the other branch.
I felt there must be a better way, but for several months I stuck to what I knew. To my surprise, many of my teammates (seasoned folks) were doing the same. This tip allowed merging without switching the branch, which made our day more productive and enjoyable.

I’ll tell you now that the local master branch is useless. You just need an active (checked out) local branch for Git to operate. So, the first step is to create a local branch from a remote master branch:
git checkout -b <new branch> --no-track origin/master
The “no-track” option instructs to create a detached branch that you can publish and create a pull request. Then, when you need to merge, you just pull from the remote master:
git pull origin master
The pull command is a shorthand for fetch plus merge. Sometimes you may want to a rebase instead:
git fetch origin master
git rebase origin/master
Rebase is good if you haven’t published your branch. It puts your changes on top of master branch changes (not buried in the middle), and it does not create an additional merge commit. With rebase, however, commits that are already published will appear as incoming and you will need to pull them. It’s a bit confusing to me so I prefer the merge/pull operation in this case.


  1. In todays every developer started adopting the rich features of Bootstrap framework. The points you have shared regarding the benefits bootstrap compels most of the business people to make use of this technology.
    Hire Dedicated Programmers
    Mobile App Development India
    Hire Opencart Developer
    Hire Wordpress Developer
    Hire Magento Developer

    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai

  2. It's a magnificent blog and it was very informative while reading. I look forward to reading more of your blogs. More info please visit:
    Hire Cake Php Developer
    Hire Phonegap Developer
    Hire Dedicated Laravel Developer
    Hire Dedicated Developers

  3. Thanks for sharing this article with us. Have a nice day.
    Hire Laravel Developer

  4. These partnerships are the primary of their type for the web casino offering, which has recently entered the regulated Ontario market. Jackpot City's cellular casino options the identical vary of video games as to the desktop variations of the casino. The cellular casino is appropriate with extensive range|a variety} of gadgets together with iPhone, iPad, Android, Blackberry and even older WAP enabled handsets. Betting limits are fairly wide on most of the pokies with the majority of of} video games starting at only one cent per line so you can get get} plenty of play time for your cash. Some of the preferred video games at Jackpot City are Mega Moolah, The 메리트카지노 Dark Knight, Cashapillar and Thunderstruck.