Many developers owns one or more instances in any of the many "cloud providers" out there. And most of them uses git to track their project. For this, github or gitlab are pretty good alternatives but, is there any other alternative?
Yes, you can use nothing or go for Bitbucket or manage your own! Which is, in fact, something ridiculous simple and you just need to have an instance/virtual machine running anywhere 1.
In your local machine (read: your laptop), create your project repository and git init it:
local: ~ $ cd ~/Code/sample local: ~/Code/sample $ git init
On the other hand, on your remote server let's init a git bare repository:
remote: ~ $ mkdir ~/git remote: ~ $ cd ~/git remote: ~/git $ git init --bare sample.git
Now, assuming that you can reach your remote service using a fancy name, like
dev.mydomain.io, let's configure our local using that name:
local: ~ $ git remote add origin firstname.lastname@example.org:/git/sample.git
After doing that, just use your git repository as usual.
Anywhere reachable by ssh ↩