git

How to create private git server

Github, Bitbucket or Gitlab are common git servers you have heard of. But do you know that you can also create your own git server with just a few lines of commands? Today I'm going to show you how to do that. In this post, I am assuming that you…

Git rebase or Git pull?

A few days ago, one member in my lab and I were about to finish a project together. We also used git server for sharing code and collaborate. However, when I used combination of git fetch, git stash, git rebase and git stash apply to fetch new code, he said…

Using git bisect to find bad commit

Today, I am going to introduce a technique to easily find out the first bad commit in your git repository. With this technique, you can save a lot of time debugging a code introduced by certain commit. Let's get started! First, assume that we have the following commits in our…

You should always commit Gemfile.lock and schema.rb

One of common mistakes I see with new (and some experienced) Ruby on Rails programmers is that they do not commit Gemfile.lock and schema.rb very often to source control version such as Git or SVN. I personally think that it is generally bad practices and we should commit…

How to configure SSH for multiple Github accounts?

Note: I only refer to Github in this post but this method can be applied to any Git servers (such as Bitbucket, Heroku, etc) If you work with Github for a while, you would realize that there are two kinds of links for you to work the Git repos: HTTPS…