gitblit软件使用


1、下载

http://www.gitblit.com/

2、安装

确保成功安装JDK的情况下安装gitblit软件
# tar -zxvf gitblit-1.8.0.tar.gz
# cd gitblit-1.8.0/data
# vim defaults.properties

修改ip地址和端口
0代表关闭

# Standard http port to serve.  <= 0 disables this connector.
# On Unix/Linux systems, ports < 1024 require root permissions.
# Recommended value: 80 or 8080
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpPort = 89

# Secure/SSL https port to serve. <= 0 disables this connector.
# On Unix/Linux systems, ports < 1024 require root permissions.
# Recommended value: 443 or 8443
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpsPort = 0
# Specify the interface for Jetty to bind the standard connector.
# You may specify an ip or an empty value to bind to all interfaces.
# Specifying localhost will result in Gitblit ONLY listening to requests to
# localhost.
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpBindInterface = 

# Specify the interface for Jetty to bind the secure connector.
# You may specify an ip or an empty value to bind to all interfaces.
# Specifying localhost will result in Gitblit ONLY listening to requests to
# localhost.
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpsBindInterface =

# Alias of certificate to use for https/SSL serving.  If blank the first
# certificate found in the keystore will be used. 
#
# SINCE 1.2.0
# RESTART REQUIRED
server.certificateAlias = ip地址

修改service-centos.sh的端口号

#!/bin/bash
# chkconfig: 3 21 91
# description: Starts and Stops gitblit
# Source function library.
. /etc/init.d/functions

# change theses values (default values)
GITBLIT_PATH=/opt/gitblit
GITBLIT_BASE_FOLDER=/opt/gitblit/data
GITBLIT_HTTP_PORT=89
GITBLIT_HTTPS_PORT=0
GITBLIT_LOG=/var/log/gitblit.log
source ${GITBLIT_PATH}/java-proxy-config.sh
JAVA="java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -cp"

3、启动gitblit

3.1 前台启动

# cd gitblit-1.8.0

# ./gitblit.sh

3.2 后台启动

# nohup ./gitblit.sh &

4、访问查看

默认的是admin/admin

5、创建用户

按照以下提示创建用户

6、创建团队

7、创建版本库

8、把项目分配给别人

先分配组再把项目分配给组中的成员

9、把代码提交项目到仓库中

http://admin@192.168.0.99/r/embraceKafkaDemo.git# git clone

# cd embraceKafkaDemo/

# 以下是把代码复制到此处

# cp -r * /home/xiaoxu/gitLocal/embraceKafkaDemo

# git add *

# git commit -m "add bew file"

# push 默认的是提交到主分支(master)

# git push

10、创建分支

# git checkout -b embrace1.0

# git branch

# git commit -m "add new branch"

# 提交到新创建的分支

# git push -u origin embrace1.0

11、客户端软件

官网:https://www.syntevo.com/smartgit/download/

Q.E.D.

知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议