# install Git
sudo apt-get install wget git-core
# add new user and user group to your pi
sudo adduser --system --shell /bin/bash --gecos 'git version control by pi' --group --home /home/git git
# set password
sudo passwd git
# swap to new user
su git
mkdir test.git
cd test.git
git --bare init
# clone
git clone ssh://git@[your IP]:[your port]/home/git/test.git
# push
git remote add pi ssh://git@[your IP]:[your port]/home/git/test.git
git add .
git commit -am "Initial"
git push pi master

Reference
[1] 用树莓派搭建Git私有服务器

Categories: Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »