Start a new project and push to remote git repo

Like many folks out there, we have been making the switch to git from svn. Although we struggled with git early on, after using both for some time I have come to appreciate the benefits of git. So here is our way of starting new projects with git.

Using gitosis on our server, we create an empty remote repo first. Then, one guy gets the project going and pushes the code into the empty repo. Here are the commands to get that going.

$ cd path/to/new/project
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin git@devserver.com:newproject.git
$ git push origin master

Posted by Adeh Tue, 25 May 2010 08:09:00 GMT