Gitosis and Gitweb – Part 2 – Add Projects and Contributors
2012-05-14 10:38
274 查看
Gitosis and Gitweb – Part 2 – Add Projects and Contributors
from:http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-2-add-projects-and-contributors/So we are setup now thanks to Part 1.
Gitosis repository contents
If we issue the “find .” command locally inside the gitosis-admin directory we will see the following:We have the .git folder, a gitosis.conf file, and a keydir with a pub key file.
Add our first project
Our project name for this example is lostechies. If you view the gitosis-admin.conf file you will see the initial content like so:This is the result of the following command from the last part:
That command puts the public ssh key into the keydirs directory and adds the associated username from the file to be the first member of the gisotis-admin project. Hence seeing user@local as the member. It matches the filename of the pub file in the keydir
directory (user@local.pub). That’s how gitosis relates members listed in the conf file to the keys in the keydir directory, filename minus the pub extension.
Let’s edit this conf file to include our lostechies project:
It looks exactly like the gitosis-admin one. Now we commit it just like we would normally when using Git. We can add, then commit or commit with the -am argument. This is possible since the gitosis-admin.conf file is already tracked by the repository.
and push it to the remote gitosis-admin repository:
We need to create the lostechies repository locally, add an initial item (README in
this case), and push it remotely. Gitosis won’t create the repository until something it pushed to it.
The lostechies repository now exists remotely. Currently my account is the only that has access. Let’s add another contributor.
Add our first contributors
Say I want to allow my friend Joe to have commit (writable) access to my lostechies repository and I want my friend Ryan to only have readonly access. I tell them to send me their public ssh keys. I make sure the files are named joe.pub and ryan.pub. I thenput them into my local gitosis-admin repository’s keydir directory and then I edit the gitosis.conf file to be:
Notice that I had to create a whole new group (lostechies_ro) to setup Ryan’s readonly access. You can’t combine readonly and writable permissions in gitosis (wish we could – open source contribution there?).
Now I need to “git add” the new keys, and commit the changes to the conf file. Finally I push the changes.
Now Joe or Ryan can clone this repository:
NOTE: Again,
if they receive the following error:
The solution, involving the .ssh/config file is in the first post in this series.
That is how you create a repository and add users.
DEBUG
If you are unable to connect you have the option of editing the gitosis.conf file with more message verbosity by adding “loglevel=DEBUG”at the top of the conf file:
This will give you more information on the ouput when trying to push to the remote repository.
Can’t push changes
As Scott Chacon states in his gitosis section of ProGit:
“If you’ve lost push access by pushing a messed-up configuration, you can manually fix the file on the server under /home/git/.gitosis.conf — the file from which Gitosis reads its info. A push to the project takes the gitosis.conf file you just pushed up and
sticks it there. If you edit that file manually, it remains like that until the next successful push to the gitosis-admin project.”
The .gitosis.conf file in the git user’s home directory is a symlink to the actual conf file in the gitosis-admin repository:
相关文章推荐
- Gitosis and Gitweb – Part 3 – Gitweb
- Add custom and listview web part to a page in wiki page using powershell
- Add custom and listview web part to wiki page using powershell
- Add Script Editor and Content Editor Web Part via powershell
- How to setup a GIT server with gitosis and gitweb
- The Difference Between “Add Web Reference” and “Add Service Reference”
- The Maven Travel(3)--Creating Dynamic Web Project and learning modular development
- Add or remove a Web Part
- redhat/centos 6.3 搭建git/gitosis/gitweb详细过程(1)
- Add/Remove listview web part in publish site via powershell
- 配置tomcat时遇到publishes and runs j2ee and java ee web projects and server configurations to a local to
- Creating a Clean, Minimal-Footprint ASP.NET WebAPI Project with VS 2012 and ASP.NET MVC 4
- Ubuntu 14.04 配置 gitosis 和 gitweb
- redhat/centos 6.3 搭建git/gitosis/gitweb详细过程(2)
- Configuring and Customizing the Content Query Web Part(转http://blogs.msdn.com/b/ecm/archive/2006/10/
- 【JAVA错误笔记】 - Unable add facets project AnnotationWebService CXF 2-x Web Services
- Eclipse Tomcat添加web项目 add and remove找不到项目
- VS 2005 Web Application Project and VS 2005 Web Deployment Project Updates[转]
- androidstudio support包报错 add google maven respository and sync project
- Web Parts, Impersonate and Security Policy, Part 1