User Tools

Site Tools




Installing Git

Install git

Configuring Git

Git Config

Global git config file:

vi ~/.gitconfig

Add aliases to gitconfig

    ci = commit
    st = status
    co = checkout

Global Git Ignore

Global git exclusion/ignore file:

vi /Users/michaelc/.gitignore_global

Add files to ignore Example:


Configure git to use the gitignore_global file

git config --global core.excludesfile ~/.gitignore_global

Repo specific config

vi .git/config

Git Commands


git reset --hard

config git branch auto setup merge

git config branch.autosetupmerge true

Create new branch

git co -b <branchname>

Create new branch from a remote branch

git co -b <branchname> origin/<remote branchname>


git co -b search_improvements origin/search_improvements

Delete branch

git br -D <branchname>

Change/Switch to branch

git co <branchname>

Stashing your stuff u dont want to commit yet and you would like to pull latest stuff from github

git stash

To unstash:

git stash pop

Pushing changes from a branch to the remote branch

git push origin <local_branch>:<remote_branch>


git push origin mysearch:search_features

Public Git repos

GIT Merge Tools

To resolve git conflicts in Mac OS X we do the following:

git mergetool

Git Tools

tig - nice git commandline tool

Install on mac os x by:

sudo port install tig

Git Sites

guides/source_control/git.txt · Last modified: 2011/02/14 13:37 by michaelc