I'm not talking about git remote add, I'm talking about actually creating "the remote", like one on GitHub, the one you have to add with git remote add. From what I know a remote is just another copy of a repo, but it's stored on some dedicated machine. I want to try hosting something like that on my local network, so I can have bootleg GitHub at home. Is it possible?
Git doesn't even need a dedicated "server" when working over SSH.
If you have shell access and appropriate permissions, you can run git init --bare in an empty directory to turn it into a Git repository. Then you can add username@hostname:path/to/dir as a Git remote and do your normal pulls and pushes, leveraging your normal SSH access, including any host aliases and config defined in ~/.ssh/config.
If you're only looking to storing your code on a remote server this is the easiest way to go.
Yes, what you are looking for is a Git "server".
The double quotes are, as others mentioned it as well, because Git doesn't really require an instance running as a server. Every Git repository is a "server" you can clone.
However, if you search for "run git server locally" in Google, you'll find plenty of results.
Referencing some of the steps from one easy example:
sudo apt-get install git-coremkdir -p $HOME/project-1.gitcd $HOME/project-1.gitgit init --baregit remote add origin ssh://git@remote-server/<path>If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With