User Tools

Site Tools


xifnet:procedures:create_git_repo

Creation of a git repo

On Satanas :

  1. ssh on satanas.net.xif.fr
  2. cd /data/git/
  3. mkdir {repo}.git && cd {repo}.git
  4. git init –bare
  5. Add sharedRepository = true into section [core] of ./config
  6. Edit ./description
  7. mv hooks/post-update.sample hooks/post-update && chmod +x hooks/post-update in order to run git update-server-info after each push
  8. git update-server-info
  9. cd .. && chown -Rv git:dev {repo}.git

Then at the local repo :

  1. git clone http://satanas.net.xif.fr:1234/git/{repo}.git && cd {repo}.git
  2. Move the code into. Commit : git add * and git commit -m "Initial commit"
  3. Edit .git/config and replace [remote "origin"] and [branch "master"] sections by :
    [remote "satanas"]
    	url = ssh://git@satanas.net.xif.fr:222/data/git/{repo}.git
    	fetch = +refs/heads/*:refs/remotes/satanas/*
    [branch "master"]
    	remote = satanas
    	merge = refs/heads/master
  4. Push the code : git push satanas master (you have to have a SSH key on git@satanas)
    You'll read * [new branch] master → master
xifnet/procedures/create_git_repo.txt · Last modified: 2016/10/23 21:41 by xif