Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set up a git respository on a home server? (If so how?)

Tags:

git

My understanding of git is basic, however I understand that a project can be "pushed" from one system to a remote system, from where it can be cloned or pulled by others to other computers.

For example, I understand that github.com is one domain where projects can be pushed to, or can be hosted.

My question is, can I set up a github like repository on a home server, to which I can then push backups of my work to, assuming that I know relevant information such as the servers IP, etc, etc.

If the answer to this question is "yes", then question number 2 is "how?".

Edit: I think I might actually be wanting to use a SVN system, not a Git one for this?

like image 943
FreelanceConsultant Avatar asked Nov 24 '25 07:11

FreelanceConsultant


1 Answers

If you can SSH into your home server, it’s as easy as making a folder (with some stuff inside it)!

[user@remote ~]$ mkdir my-project
[user@remote ~/my-project]$ cd my-project/
[user@remote ~/my-project]$ git init --bare

and

[me@local ~/my-project]$ git remote add home-server ssh://user@remote/my-project

This creates a bare remote repository, which is essentially the same as the .git folder in your local one.

like image 144
Ry- Avatar answered Nov 25 '25 21:11

Ry-



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!