Linux For Cynics One user's experiences with Linux

9Sep/130

Pull a Git Branch from Remote

In order to check out a remote git branch, first do a git pull:

git pull 

Then

git checkout -b [new_branch] > origin/[new_branch]

So for example, if your branch name is "newfeature", you'd do:

git pull
git checkout -b newfeature origin/newfeature
Tagged as: No Comments
11Mar/130

Git in Color

To enable color in git, simply use this command:

git config --global --add color.ui true

That adds the following lines to your .gitconfig:

[color]
        ui = true

There, now you'll see git's greens and reds, which make it much easier to see what's changed.

Don't worry, the color codes will only be used in interactive mode and not when piping output from git to other programs.

Tagged as: No Comments