26th July 2024

Installing Git Server on Windows

After some research, we came to the conclusion that Gitea met our needs for a project. Although GitHub has become free as you know, we will still set up a “Git” server with our own means. Gitea is a git server written in “go” and can meet the needs of teams between 1-100 in terms of performance. First of all, if “go” is not installed on our server, we need to install it. For this, we go to the link below and simply perform the installation.

https://go.dev/dl/

download Git server
download Git server
install go
install go
install go
install go

 

In addition, we need to install a “git client” on the system so that golang can pull the packages. Download and install “git client” from the link below.

https://git-scm.com/downloads

download golang
download golang
install golang
install golang
install golang
install golang

 

After the installation, we open a command line window and type the following commands in order.

Note: After completing these operations, you can move the gitea folder under the c directory as “c:\gitea“.

mkdir %GOPATH%
cd %GOPATH%
go get -d -u code.gitea.io/gitea
cd “%GOPATH%/src/code.gitea.io/gitea”
go build

gitea web

Then you can access the gitea interface with http://localhost:3000 and make the first installations.

Running as a Service

We will not manually launch this application every time. We will define this application as a service. For this, we go to the “C:\gitea\custom\conf\app.ini” file and make “RUN_USER = COMPUTERNAME$” where it says “RUN_USER = git“. Then we open a new command line and write the following command.

sc create gitea start= auto binPath= “”C:\gitea\gitea.exe” web — config “C:\gitea\custom\conf\app.ini””
create gitea start= auto
create gitea start= auto

 

Finally, we find the “gitea” service from Windows services (services.msc) and right click and run it.

LEARN MORE  Manually Remove McAfee EDR and McAfee Agent on Linux
 start "gitea" service
start “gitea” service

 

References:

https://docs.gitea.io/en-us/install-from-source/
https://docs.gitea.io/en-us/windows-service/

 

Leave a Reply

Your email address will not be published. Required fields are marked *