Created
April 28, 2014 01:37
-
-
Save wilsonsilva/11359814 to your computer and use it in GitHub Desktop.
How to set up a remote git repository on a remote machine
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
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 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
Hello, is this information up to date?