At work, we need to submit our own code or project to our repository. Commonly used repositories include github gitee, etc. How to build your own private git repository?
About Gogs
Gogs, full name Go Git Service, is a Git service developed based on the Go language. It provides an interface and features similar to GitHub, allowing you to build a private Git repository and code hosting platform (similar to gitlab) on your own server. Its design and performance optimization make it suitable for small teams and individual developers. It has a web interface that allows you to easily manage and browse repositories, handle issues, conduct code reviews, and manage team members.
Features
Open Source Free: Gogs is released under the MIT license and can be used, modified and distributed for free. Lightweight: Gogs is written in Go, easy to deploy and run, and consumes less memory in terms of resource consumption. Fast and Stable: Gogs uses some performance optimization measures to improve its response speed and stability. Easy to use: Gogs has an intuitive user interface that allows users to quickly get started and perform version control and collaborative development. Integrated features: Gogs supports some common features, such as problem tracking, code review, web hooks, etc. Multiple database support: Gogs can be integrated with a variety of common databases, including SQLite, MySQL, PostgreSQL, etc. Support extensions: Gogs has a rich plug-in system that allows users to customize extensions according to their needs.
Installation
Here we take centos7 as an example to install it.
First, we need to install the mysql database. If the database is installed, just create the corresponding database.
Here we use the simplest yum command to install it
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
cd /etc/yum.repos.d/
yum install mysql-server --nogpgcheck installation, start the database
systemctl start mysqld
Get temporary password
grep 'temporary password' /var/log/mysqld.log
Log in with the temporary password you just obtained
mysql -u root -p
Modify the root password
set password for root@localhost=password('666');ex Next, we create a database
create database git; At this point, the database configuration is completed. If yours is in a pagoda environment, just create a database in the pagoda.
Installing gogs
First go to the official website to download the binary package according to the corresponding system version
wget https://dl.gogs.io/0.13.0/gogs_0.13.0_linux_amd64.zip
unzip gogs_0.13.0_linux_amd64.zipls
After the ./gogs web is completed, visit ip:3000 to enter the installer.
Fill in database information
Basic configuration information
Fill in pit errors and cannot be recognized 'git' command: exec: 'git': executable file not found in $PATH
We need the yum command to install git.
yum install git create account information
After the configuration is complete, click Install Now. Wait for completion effect
Login
Create your own repository
Push local project to Gogs repository
Here, let's take idea as an example
IDEA opens an ready-made project and adds gogs remote repository
After clicking OK, wait for download and install git.
After the installation is completed, the git menu bar will appear and click Manage Remote Address.
Synchronous Code
Select the project document - right-click git - submit and push
At this point, we have configured our own private repository.