Skip to content

Instantly share code, notes, and snippets.

@Obsidion
Created September 8, 2011 21:28
Show Gist options
  • Save Obsidion/1204800 to your computer and use it in GitHub Desktop.
Save Obsidion/1204800 to your computer and use it in GitHub Desktop.
Create bare git repo
---------NO CODE YET--------
on server:
git init --bare
then clone it locally:
git clone git@server:/myNewRepo.git
-----HAVE LOCAL REPOSITORY---------
Set up the new bare repo on the server:
$ ssh myserver.com
Welcome to myserver.com!
$ mkdir /var/git/myapp.git && cd /var/git/myapp.git
$ git --bare init
Initialized empty Git repository in /var/git/myapp.git
$ exit
Bye!
Add the remote repository to your existing local git repo and push:
$ cd ~/Sites/myapp
$ git remote add origin ssh://myserver.com/var/git/myapp.git
$ git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment