Ask Your Question

How setup git server on fedora ?

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

sergiomb gravatar image

updated 2018-12-14 23:58:10 -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

Update: After I tested gitosis I conclude and be aware gitosis is very limited for example do not permit access RW+ etc , I don't recall well

edit retag flag offensive close merge delete

3 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-06-14 05:48:31 -0500

Tuncay Göncüoğlu gravatar image

As villykruse explained above, if you intend to use ssh protocol, you need nothing but the base git package just to have the git command, and a directory you can write to. However, I find it to use https protocol more secure not giving shell access, and besides, I'd like to see a nice web page with history, tickets etc. My personal preference is GoGS . It runs great even on comparatively weak devices such as a Raspberry PI, can be deployed to linux and windows alike, and... is simply awesome.

Note: I have nothing to do with that project, except that I'm a happy user.

Another good git server I found is gitblit . However that one is a java application, which will require a java application server such as tomcat or jetty. Not terribly hard to set up really, but it is a bit more resource-hungry.

Of course there are a lot more choices out there, like gitlab for instance, but these two I mentioned I find the most suitable ones for my needs, which I would guess are similar to yours.

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

Question Tools

1 follower


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

Seen: 1,770 times

Last updated: Dec 14 '18