Thursday, 5 September 2013

Setup Git server on Raspberry Pi


Install required packages by typing:
sudo apt-get install git git-core

add a user git:
sudo adduser --system --shell /bin/bash --gecos 'git version control user' --group --home /home/git git

set the password for the new user
sudo passwd git

in git home folder create the git directory
mkdir myrepo.git

alternatively place the git repository somewhere else and make a symlink to it. Just ensure that the git user is the owner of the directory.
chown -R git:git myrepo.git

cd into the myrepo.git folder and initialize it by typing:
git --bare init

On the client, use the following URL to access the git repository:
git@IpAddress:myrepo.git

No comments:

Post a Comment