Git Server
August 5, 2020Less than 1 minute
Git Server
Tips
build a git server
the easy to build a server for guys with same permission on Linux
install git & configure
apt install git
yum install gitadd user name git, it is only used when needing RSA
Here I just used this user as a folder
/home/git/
useradd -d /home/git git
passwd gitedit /etc/passwd
git:x:1000:1000::/home/git:/usr/bin/git-shellInitialized empty Git repository
it is a repository that doesn’t contain a working directory (name.git)
the --bare means that it is only the .git part without working directory.
Initialized empty Git repository in /home/git/name.git/
git init --bare name.gitor If there exists a repositoty
make a new bare repository and scp to server
git clone --bare my_project my_project.git
scp -r my_project.git user@git.example.com:/home/gitanyone and clone through SSH
git clone root@domain:/home/git/name.git