Hoping you have your own VPS setup by now
SSH into GIT SERVER: you can either create a new user or remain root and give other also root priviledges [dangerous]
ssh root@<Your server's IPV4 addr or domain>
# or
ssh <new-user>@<Your server's IPV4 addr or domain>
optionally you can also add your ssh public key to the git server
ON GIT SERVER : For creating a new git repo:
mkdir /gits
cd /gits
git init --bare <your-project-name>.git
ON CLIENT SIDE: For pushing first time: [cd into your project dir]
git init
git add .
git commit -m “commit message” -a
git remote add origin root@<Your server's IPV4 addr or domain>:/gits/<your-project-name>.git
or
git remote add origin <new-user>@<Your server's IPV4 addr or domain>:/gits/<your-project-name>.git
git push -u origin master
Note: Have a readme file, license file and gitignore file. These help!
For cloning an existing project
git clone root@<Your server's IPV4 addr or domain>:/gits/<your-project-name>.git
# or
git clone <new-user>@<Your server's IPV4 addr or domain>:/gits/<your-project-name>.git
You know how to fork and all that stuff