It seems like everyone is using github these days, and it is easy to fork and branch trough it’s UI. But what if you are just starting with using git?

I will reveal a few not so hidden secrets of git. First, github is based on git, so if you just been reading github documentation, you are missing out on a lot of great documentation that can be found here: http://git-scm.com/doc.

Second, when you are using github, you are really working with two repositories, not one. The first one is on your local machine, set up to point to the second, remote repo.

Here are a few tips on how to configure your local repo:

You will want to start with git config tool to configure your git profile. git config will setup your identity and some preferences.

Start with setting your name:

egle@ubuntu:~/testRepo$ git config --global user.name "Any Stacker"
 egle@ubuntu:~/testRepo$ cat ~/.gitconfig
 [user]
 name = Any Stacker

A few more settings:

egle@ubuntu:~/testRepo$ git config --global merge.tool vimdiff
 egle@ubuntu:~/testRepo$ cat ~/.gitconfig
 [user]
 name = Any Stacker
 [merge]
 tool = vimdiff
 egle@ubuntu:~/testRepo$ git config --global core.editor vi
 egle@ubuntu:~/testRepo$ git config --list
 user.name=Any Stacker
 merge.tool=vimdiff
 core.editor=vi
 core.repositoryformatversion=0
 core.filemode=true
 core.bare=false
 core.logallrefupdates=true
 remote.origin.url=https://github.com/eglute/testRepo.git
 remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
 branch.master.remote=origin
 branch.master.merge=refs/heads/master
 egle@ubuntu:~/testRepo$

Don’t be a git, check in your code often!

-eglute