Ask Your Question

How setup git server on fedora ?

asked 2018-02-07 11:15:55 -0500

sergiomb gravatar image

updated 2018-02-09 11:15:43 -0500

Hi, I wonder if anyone have a quick and easy way to install a git server on fedora to organize my current developments ?

Answer myself:

dnf install gitosis 
vi /usr/share/doc/gitosis/README.fedora
vi /usr/share/doc/gitosis/README.rst

as root

su - gitosis 
gitosis-init < /tmp/

(use your ~/.ssh/ already generated for ssh connections )

with your regular user (here you got ~/.ssh/

git clone gitosis@localhost:gitosis-admin.git
cd gitosis-admin/
vi gitosis.conf
git commit .
git push

cd ../your_project
git remote add myserver git@localhost:myproject.git (myproject was defined in gitosis.conf and you gave to use premissions to write ) 
git push myserver master:refs/heads/master

in other local :

git clone gitosis@localhost:myproject.git

Integrate with cgit:

vi /etc/cgitrc


repo.desc=the master demo1 repository


usermod --append --groups gitosis apache


systemctl restart httpd

and http://localhost/cgit/ should work

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-02-07 12:04:43 -0500

villykruse gravatar image

This depends on what you want to do with it. If you create a bare repsoditory:

git init --bare $home/gitproject

you can treat that as a server when you want to experiment. For example

cd /tmp
git clone $home/gitproject
cd gitproject

create files etc

git add .
git commit -m 'Commit message'
git push

For remote access you need to allow incomming ssh access.

git clone ssh://hostname/home/username/gitproject

where hostname is the hostname where the repository is, and username is your login user name.

For multi user access, there are additional issues.

edit flag offensive delete link more

answered 2018-02-07 12:01:08 -0500

This should work. However, the Gitolite might not be available on Fedora. The first half should work under basic logic. Just remember to use dnf instead of apt-get/apt

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-02-07 11:15:55 -0500

Seen: 305 times

Last updated: Feb 09