Git related stuff

Git basics

Some links:



Create local copy of repository - clone

sudo git clone

Update remote repository - push

sudo git commit -a
sudo git push

Update local repository - pull

sudo git pull

Note on new repositories

Might need to create a branch (master):

git push origin master

Also setup default origin and branch for merge:

git config branch.master.remote origin && git config branch.master.merge refs/heads/master

Level two

Create a new repository on the command line

git init
git add
git commit -m "first commit"
git remote add origin
git push -u origin master

Push an existing repository from the command line

git remote add origin
git push -u origin master

Convert a svn repositiry to git

 svn2git --rootistrunk

Avoid entering username and password (on OSX)

  • See
curl -s -O
chmod u+x git-credential-osxkeychain
sudo mv git-credential-osxkeychain /usr/local/git/bin
git credential-osxkeychain
git config --global credential.helper osxkeychain


The open source Gollum wiki manager is used. Markdown (and other markups) are supported.



Advanced stuff

Merge two repositories into one


Crate new repository to merge into

mkdir gom && cd gom
git init
touch .gitignore
nano test
git add test 
git commit -a

Merge first repository into new repository

git remote add -f gom-qa ../gom-qa
git merge -s ours --no-commit gom-qa/master
git read-tree --prefix=gom-qa -u gom-qa/master
git commit -a

Merge second repository into new repository

git remote add -f gom-test ../gom-test
git merge -s ours --no-commit gom-test/master
git read-tree --prefix=gom-test -u gom-test/master
git commit -a

Create repository from sub-directory




Setup a server

It is relatively simple to setup a server (with advanced user management):