I have various Git projects that are on my local machine. I have a server that I would like to use as my remote Git Repository. How do I move my local Git Repositories (Pro
Create a git repository on the server (you can use gitolite/gitosis or just a normal user account + pubkey ssh auth), add the server to your local git repository using
git remote add name url
and use git push -u name master (-u marks the current branch as tracking so you can just git pull instead git pull name master).
On the server side (debian based system):
adduser --system --home /home/git --bash /bin/bash git
su - git
mkdir .ssh
cat yourkey.pub > .ssh/authorized_keys
Now, create a new bare repository for each local repository using
mkdir projectName
cd projectName
git init --bare
After that, the url would be git@yourserver:projectName.