Search code examples
gitsvnversion-control

Git svn configure local reposity


I have an svn local repository and my goal is to convert it to git.

I followed this tutorial : http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git (part Subversion) For last command i did that:

    $ git remote add origin .

    $ git push origin --all
    already up to date
    $ git push origin --tags
    already up to date

I need a few advice on last things to do:

I need to block master branch for one user ( admin ). I need to create branch for dev, i mean, a dev clone this rep and get branch master and all dev branch, he can only push and his dev branch.

For now, when i clone i only have master branch and cannot even push on it (bare problem).

This git rep must be accessible by a lot of devs, they can commit and push on their branch and admin merge on master.


Solution

  • Other thank using external software such as gitolite, you could use server side hooks.

    In your case you could either use pre-receive or update hooks.

    pre-receive is the first script to run when handling a push from a client. It takes a list of references that are being pushed from stdin; if it exits non-zero, none of them are accepted.

    update script is very similar to the pre-receive script, except that it’s run once for each branch the pusher is trying to update. If the pusher is trying to push to multiple branches, pre-receive runs only once, whereas update runs once per branch they’re pushing to. Instead of reading from stdin, this script takes three arguments: the name of the reference (branch), the SHA-1 that reference pointed to before the push, and the SHA-1 the user is trying to push. If the update script exits non-zero, only that reference is rejected; other references can still be updated.

    I suggest you to further read on http://git-scm.com/book/en/Customizing-Git-An-Example-Git-Enforced-Policy and, of course, the manual page at http://git-scm.com/docs/githooks.html