Skip to content

Instantly share code, notes, and snippets.

@johnhunter
Created April 21, 2012 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnhunter/2437138 to your computer and use it in GitHub Desktop.
Save johnhunter/2437138 to your computer and use it in GitHub Desktop.
Add a local repo to a remote
Create a git repo and push to remote:
mkdir new_git_repo
cd new_git_repo
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@my.remote.com/new_git_repo.git
git push -u origin master
Existing Git Repo?
cd existing_git_repo
git remote add origin git@my.remote.com/existing_git_repo.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment