Git Tricks

List of useful commands for using git repositories

git initial commit

Execute this command on the server:

git init --bare projectdir

Execute these commands on the client:

git init
git add .
git remote add origin ssh://git@server:port/absolutepath
git commit -m "initial commit"
git push origin master

To convert from an SVN repository:

git svn clone --stdlayout --no-metadata --authors-file=users.txt https://server/path destination

Use --stdlayout if the repository uses trunk branches and tags, otherwise you can omit it.

In the users file you can specify the mapping of usernames:

user = firstname lastname <email>