This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |
xifnet:procedures:create_git_repo [2016/10/23 20:12] – xif | xifnet:procedures:create_git_repo [2016/10/23 21:41] (current) – xif |
---|
| ====== Creation of a git repo ====== |
| |
| On Satanas : |
| - ssh on ''satanas.net.xif.fr'' |
| - ''cd /data/git/'' |
| - ''mkdir {repo}.git && cd {repo}.git'' |
| - ''git init --bare'' |
| - Add ''sharedRepository = true'' into section ''[core]'' of ''./config'' |
| - Edit ''./description'' |
| - ''mv hooks/post-update.sample hooks/post-update && chmod +x hooks/post-update'' in order to run ''git update-server-info'' after each push |
| - ''git update-server-info'' |
| - ''cd .. && chown -Rv git:dev {repo}.git'' |
| Then at the local repo : |
| - ''git clone %%http://satanas.net.xif.fr:1234/git/{repo}.git%% && cd {repo}.git'' |
| - Move the code into. Commit : ''git add *'' and ''git commit -m "Initial commit"'' |
| - Edit ''.git/config'' and replace ''[remote "origin"]'' and ''[branch "master"]'' sections by : <code> |
| [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 |
| </code> |
| - Push the code : ''git push satanas master'' (you have to have a SSH key on ''git@satanas'')\\ You'll read '' * [new branch] master -> master'' |
| - Enjoy your hard work at [[http://satanas.net.xif.fr:1234/gitw/?p={repo}.git]] |