Created
September 8, 2011 21:28
-
-
Save Obsidion/1204800 to your computer and use it in GitHub Desktop.
Create bare git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------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