Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Gitblit tools to create Git Warehouse in Linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use Gitblit tools in the Linux system to create a Git warehouse", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use Gitblit tools in the Linux system to create a Git warehouse" bar!

Gitblit is completely open source software based on a pure Java stack and is designed to be suitable for projects ranging from small to very large in terms of Git repository speed and efficiency. It is easy to learn and use, and has lightning-like performance. It is much better than SCM (version control) tools such as Subversion, CVS, Perforce and ClearCase in many ways, such as fast local branching, easy temporary storage, multiple workflows, and so on.

The function of Gitblit

It can be used as a dumb warehouse view without administrative controls and user accounts.

It can be used as a complete Git service with cloning, push and warehouse access control.

It can be used independently of other Git tools (including the actual Git), and it can collaborate with your existing tools.

1. Create a Gitblit installation directory

First we will set up a directory on our server and install the latest Gitblit in that directory.

The code is as follows:

$sudo mkdir-p / opt/gitblit

$cd / opt/gitblit

two。 Download and decompress

Now we will download the latest version of Gitblit from the official Gitblit website. Here we will install version 1.6.2. Therefore, please modify the command according to the specific version during installation.

The code is as follows:

$sudo wget http://dl.bintray.com/gitblit/releases/gitblit-1.6.2.tar.gz

Next, we unzip the downloaded tar package to the directory / opt/gitblit/ created earlier

The code is as follows:

$sudo tar-zxvf gitblit-1.6.2.tar.gz

3. Configure and run

Now we will configure Gitblit. If you want to customize the behavior of Gitblit, you can modify gitblit/data/gitblit.properties. After completing the configuration, we will run the installed gitblit. There are two ways to run gitblit. The first is to run it manually with the following command:

The code is as follows:

$sudo java-jar gitblit.jar-baseFolder data

The other is to add gitblit as a service. Here are the steps to add gitblit as a service under linux.

Since I am using Ubuntu, the following command will be sudo cp service-ubuntu.sh / etc/init.d/gitblit, so please change the file name service-ubuntu.sh to the corresponding distribution you are running according to your distribution.

The code is as follows:

$sudo. / install-service-ubuntu.sh

$sudo service gitblit start

Open http://localhost:8080 or https://localhost:8443 in your browser, or replace localhost with an IP address according to your local configuration. Enter the default administrator credentials: admin / admin and click the login button.

Now, we will add a new user. First, you need to log in as the admin user, username = admin,password = admin.

Then, click the user icon > users > (+) new user to create a new user, as shown in the following figure.

Now we will create a warehouse that can be used out of the box. Click repositories > (+) new repository. Then, add a new warehouse as shown in the following figure.

Create a new warehouse using the command line

The code is as follows:

Touch README.md

Git init

Git add README.md

Git commit-m "first commit"

Git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git

Git push-u origin master

Please replace the user name arunlinoxide with the user name you added.

Push an existing warehouse on the command line

The code is as follows:

Git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git

Git push-u origin master

Note: it is strongly recommended that everyone change the password of the user name "admin".

Thank you for your reading, the above is the content of "how to use Gitblit tools in the Linux system to create a Git warehouse". After the study of this article, I believe you have a deeper understanding of how to use Gitblit tools in the Linux system to create a Git warehouse, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report