English
Ask Your Question
1

How setup git server on fedora ?

asked 2018-02-07 17:15:55 +0000

sergiomb gravatar image

updated 2018-02-09 17:15:43 +0000

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

2 answers

Sort by ยป oldest newest most voted
1

answered 2018-02-07 18:04:43 +0000

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 18:01:08 +0000

Wherkamp gravatar image

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

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2018-02-07 17:15:55 +0000

Seen: 71 times

Last updated: Feb 09