How to Install Git Server in the PI

来源:互联网 发布:南京大学网络教育2017 编辑:程序博客网 时间:2024/05/29 18:02

install the git software:

sudo apt-get install wget git-core

if you don’t have ssh,install it:

sudo apt-get install ssh

start ssh:

sudo /etc/init.d/ssh start

set default start:

sudo update-rc.d ssh defaults

add a user and group named git:

adduser --system --shell /bin/bash --gecos 'git version control by pi' --group --home /home/git gitpasswd gitsu gitcd /home/git

install a new Repo:

mkdir myRepo.gitcd myRepo.gitgit --bare init

add a new remote host(my PI’s IP is 192.168.1.102)

git remote add origin git@192.168.1.102 :/home/git/myRepo.git
git clone git@192.168.1.102:/home/git/myRepo.git##add some files,do some modificationgit add .git commit -am "Initial"git push origin master