2

I'm switching from SVN to Git with Gitosis installed on a central server for centralized repositories on Ubuntu server.

I have had all my SVN repositories moved and initiated into new Git repositories, and also had all history moved to Git.

Now that I have all the repositories migrated to Git, I want to add all the repositories into Gitosis to be managed by Gitosis.

How can I move the repositories (Git initiated ones) into Gitosis /srv/gitosis/repositories and manage them through gitosis-admin.git remotely?

Mohammed J. Razem
  • 342
  • 1
  • 4
  • 19

2 Answers2

4

The idea is to declare you repo in the conf/gitosis.conf file from your gitosis-admin local (cloned) repo:

[group groupname]
writable = reponame
members = username

git add -A
git ci -m "updated configuration"
git push

, which will create a bare repo, to which to which you can push your local repo.

mkdir myproject
cd mypyroject
git init
# do some work, git add and commit files
# Then add your server as a remote and push:

git remote add serveralias git@hostname:reponame.git
git push serveralias master

See this tutorial for more


That being said, I find gitolite much more complete than gitosis, like all those recent blog posts illustrate:

And you can migrate from gitosis to gitolite easily enough.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But does this maintain the history once moved to Gitosis? – Mohammed J. Razem Nov 13 '10 at 14:50
  • @doublethink: sure, you are pushing the all history. You can make a `git push --mirror` at first (only at first) to be extra sure. (http://stackoverflow.com/search?q=[git]+push+mirror) – VonC Nov 13 '10 at 14:55
  • Hm, on second thought, I think I'd better let you sort out your gitolite vs gitosis thing - "gitolite much more complete than gitolite", and is that a gitosis config? – Cascabel Nov 13 '10 at 15:13
  • @Jefromi: fixed. I was looking at both gitosis and gitolite config files when writing this answer, which helps explain the inversion. The main part of this answer is about gitosis. – VonC Nov 13 '10 at 19:56
  • Cool; I was pretty sure that was it, but didn't want to mess anything up! – Cascabel Nov 13 '10 at 20:33
0

I recommend this tutorial for managing gitosis repositories if you have successfully installed it:

http://fclose.com/b/1434/managing-repositories-on-git-server-using-gitosis/

Most of the normal management work (Add new administrator, Create a new user, Create a new repository, etc) can be done on administrator's side by editing and pushing gitosis-admin repository. You need to login to the gitosis server to do other things like adding hook script to send email automatically when somebody pushes, etc.

ericzma
  • 763
  • 3
  • 9
  • 23