Another record of what I did, but not why. Installed Linux Mint on a cheap PC, so I can get off the very broken Git on Windows. I use VNC viewer to access this machine.

Brief note on VNC on Mint: vino-preferences Set the password and port. References:

Back to git:


Login to the linux server:

sudo apt-get install git-core
git config --global "John Smith"
git config --global
git --version

On the PC, generate the SSH key: Use msysGit (see google!). Open Git Bash window.

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/JohnSmith/.ssh/id_rsa):
Created directory '/c/Users/JohnSmith/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/JohnSmith/.ssh/id_rsa.
Your public key has been saved in /c/Users/JohnSmith/.ssh/
The key fingerprint is:

On the linux server

sudo adduser git
su git
mkdir .ssh
cd .ssh
vi authorized_keys

Now paste in the contents of the files that the users have generated on their PC’s.

cd /home/git
mkdir <project_name>.git
cd <project_name>.git
git --bare init

Then on the client PC’s

cd <project>
git init
git add .
git commit -m 'initial commit'
git remote add origin git@gitserver:/home/git/<project>.git
git push origin master

Or on a PC without the code

cd <project> 
git init
git remote add origin git@gitserver:/home/git/<project>.git
git pull origin master

If you mess up the address then this is useful

git remote rm origin