centos gitolite tortoisegit 搭建

 

 

 

yum install git-core

# 创建git版本管理用户 git  
useradd -c 'git version manage' -m -d /home/git -s /bin/bash git

su git

cd ~

git clone git://github.com/sitaramc/gitolite

mkdir -p $HOME/bin

gitolite/install -to $HOME/bin

ssh-keygen

./gitolite setup -pk git-root.pub

exit

su root

cd ~

ll .ssh

mkdir .ssh

cd .ssh/

cp /home/git/bin/git-root.pub .

vim config

Host lm-git
HostName 192.168.13.129
User git
Port 22
IdentityFile ~/.ssh/git-root

cd ~

git clone lm-git:gitolite-admin

cd gitolite-admin/ 

cd keydir/

添加公钥到/root/gitolite-admin/keydir

git add .

git commit -m 'add pub-key' 

git push origin master

git log 

git branch -a 

cd ~  

vim gitolite-admin/conf/gitolite.conf   

git add .  
git status  
cd gitolite-admin/  
git add .  
git status  
git commit -m 'update conf'  
git push origin master  
exit


git add conf
git add keydir
git commit -m "added foo repo, gave access to Jason"
git push

======================================================================


# 创建git版本管理用户 git
sudo useradd -c 'git version manage' -m -d /home/git -s /bin/bash git

# 更改git用户的密码
sudo passwd git

# su 到git用户
su - git
gitosis-init < /tmp/id_rsa.pub

https://github.com/sitaramc/gitolite



git clone git://github.com/sitaramc/gitolite
ll
mkdir bin
ll bin/
cd gitolite/
ll
./install -to $HOME/bin
cd ../bin/
ll
ssh-keygen 
ll
gitolite setup -pk git-root.pub
./gitolite setup -pk git-root.pub
exit

cd ~
ll
ll .ssh
cp /home/git/bin/git-root .
ll
mkdir .ssh
mv git-root .ssh/
vim .ssh/config
git clone share-git:gitolite-admin
ll
cd gitolite-admin/
ll
vim conf/gitolite.conf 
l
ll
cd keydir/
ll
cp /tmp/paris.liming.pub 
cp /tmp/paris.liming.pub ./
ll
cd ..
ll
vim conf/gitolite.conf 
cd keydir/
ll
git status
cat paris.liming.pub 
mv paris.liming.pub liming.pub
git add .
git status
git commit -m 'add liming's pub-key'
git commit -m 'add liming\'s pub-key'
git commit -m 'add pub-key'
git push origin master
git log
git branch -a
cd /
ll
cat ~/.ssh/config 
ll
~
cd ~
ll
vim gitolite-admin/conf/gitolite.conf 
git add .
git status
cd gitolite-admin/
git add .
git status
git commit -m 'update conf'
git push origin master
exit

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值