Git on Mint – May 2014
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: http://ubuntuforums.org/archive/index.php/t-266981.html http://askubuntu.com/questions/4474/enable-remote-vnc-from-the-commandline |
Back to git:
References: http://git-scm.com/book/en/Git-on-the-Server-Generating-Your-SSH-Public-Key http://guides.beanstalkapp.com/version-control/git-on-windows.html
Login to the linux server:
sudo apt-get install git-core git config --global user.name "John Smith" git config --global user.email john.smith@noplace.com 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/id_rsa.pub. The key fingerprint is: ...
On the linux server
sudo adduser git su git cd mkdir .ssh cd .ssh vi authorized_keys
Now paste in the contents of the id_rsa.pub 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