搭建gitblit并通过客户端创建分支推送到gitblit

1.创建安装目录:
mkdir -p /opt/gitblit

root@ubuntu:~# mkdir -p /opt/gitblit
root@ubuntu:~# ls
certs.d  docker  IdeaProjects  opt

2.复制安装包到/opt/gitblit:
cp gitblit-1.8.0.tar.gz /opt/gitblit

root@ubuntu:/home/zst/Desktop# cp gitblit-1.8.0.tar.gz /opt/gitblit
root@ubuntu:/home/zst/Desktop# cd /opt/gitblit/
root@ubuntu:/opt/gitblit# ls
gitblit-1.8.0.tar.gz
root@ubuntu:/opt/gitblit# 

3.解压缩:
tar -zxvf gitblit-1.8.0.tar.gz

4.添加配置
cd gitblit-1.8.0/data
vim gitblit.properties
添加以下配置信息
***********
include = defaults.properties
server.httpPort=9696
server.httpBindInterface=192.168.216.133
server.httpsBindInterface=localhost

5.开机自启动
cd /opt/gitblit/gitblit-1.8.0
vim service-ubuntu.sh

××××××××××修改以下配置××××××××××××××××××××××××××××××××××××××
# change theses values (default values)
GITBLIT_PATH=/opt/gitblit/gitblit-1.8.0/
GITBLIT_BASE_FOLDER=/opt/gitblit/gitblit-1.8.0/data/
GITBLIT_USER="admin"
source ${GITBLIT_PATH}/java-proxy-config.sh
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

搭建gitblit并通过客户端创建分支推送到gitblit_第1张图片

./install-service-ubuntu.sh

root@ubuntu:/opt/gitblit/gitblit-1.8.0# vim service-ubuntu.sh 
root@ubuntu:/opt/gitblit/gitblit-1.8.0# ./install-service-ubuntu.sh
root@ubuntu:/opt/gitblit/gitblit-1.8.0# 


6.手动启动gitblit
cd /opt/gitblit/gitblit-1.8.0
nohup ./gitblit.sh &

root@ubuntu:/opt/gitblit/gitblit-1.8.0# nohup ./gitblit.sh &
[1] 49817
root@ubuntu:/opt/gitblit/gitblit-1.8.0# nohup: ignoring input and appending output to 'nohup.out'


7.登陆gitblit
浏览器输入 192.168.216.133:9696   默认账号密码: admin/admin

8.创建项目并推送到git服务器
cd 到本地项目所在文件目录
 git init
 git add .
 git status
 git commit -m "init"
 git remote add origin http://[email protected]:9696/r/addressbook.git
 git branch
 git push -u origin master

9.从gitblit下载分支到本地
mkdir addressbook
cd addressbook
git clone http://[email protected]:9696/r/addressbook.git

 

 

 

你可能感兴趣的:(git)