Skip to content

Instantly share code, notes, and snippets.

@wilsonsilva
Created April 28, 2014 01:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilsonsilva/11359814 to your computer and use it in GitHub Desktop.
Save wilsonsilva/11359814 to your computer and use it in GitHub Desktop.
How to set up a remote git repository on a remote machine
On the remote server:
mkdir -p /home/username/repositories/my-repo.git
cd /home/wsilva/repositories/my-repo.git
git init --bare
On my machine:
git remote add git remote add origin username@hostname:/home/wsilva/repositories/my-repo.git
git push origin master
username: the username on the remote machine
hostname: the hostname of the remote machine (may be an ip address)
my-repo.git: the name of the repository
@isalotra
Copy link

Hello, is this information up to date?

@wilsonsilva
Copy link
Author

wilsonsilva commented Jan 14, 2024

@isalotra It should work. But I haven't tried it. I don't even remember writing this ahaha. If it fails, you can paste it into ChatGPT and ask it to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment