Ask Your Question
1

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 ?
Thanks

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/id_rsa.pub

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

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

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.url=demo1
repo.path=/var/lib/gitosis/repositories/demo1.git
repo.desc=the master demo1 repository
repo.owner=sergio.basto
repo.readme=info/web/about.html

.

usermod --append --groups gitosis apache

.

systemctl restart httpd

and http://localhost/cgit/ should work

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

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 https://gogs.io/ . 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 http://gitblit.com/ . 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
1

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
0

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

This should work. https://help.ubuntu.com/lts/servergui... 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

Stats

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

Seen: 564 times

Last updated: Feb 09