搭建gitblit并通过客户端创建分支推送到gitblit
1.创建安装目录:
mkdir -p /opt/gitblit
[email protected]:~# mkdir -p /opt/gitblit
[email protected]:~# ls
certs.d docker IdeaProjects opt
2.复制安装包到/opt/gitblit:
cp gitblit-1.8.0.tar.gz /opt/gitblit
[email protected]:/home/zst/Desktop# cp gitblit-1.8.0.tar.gz /opt/gitblit
[email protected]:/home/zst/Desktop# cd /opt/gitblit/
[email protected]:/opt/gitblit# ls
gitblit-1.8.0.tar.gz
[email protected]:/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
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
./install-service-ubuntu.sh
[email protected]:/opt/gitblit/gitblit-1.8.0# vim service-ubuntu.sh
[email protected]:/opt/gitblit/gitblit-1.8.0# ./install-service-ubuntu.sh
[email protected]:/opt/gitblit/gitblit-1.8.0#
6.手动启动gitblit
cd /opt/gitblit/gitblit-1.8.0
nohup ./gitblit.sh &
[email protected]:/opt/gitblit/gitblit-1.8.0# nohup ./gitblit.sh &
[1] 49817
[email protected]:/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