[root@localhost ~]# sudo -H -u git gitosis-init < ~/id_rsa.pub
Traceback (most recent call last):
File "/usr/bin/gitosis-init", line 9, in <module>
load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-init')()
File "/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/app.py", line 24, in run
return app.main()
File "/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/app.py", line 38, in main
self.handle_args(parser, cfg, options, args)
File "/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/init.py", line 138, in handle_args
user=user,
File "/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/init.py", line 75, in init_admin_repository
template=resource_filename('gitosis.templates', 'admin')
File "/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/repository.py", line 63, in init
close_fds=True,
File "/usr/lib64/python2.6/subprocess.py", line 478, in call
p = Popen(*popenargs, **kwargs)
File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
errread, errwrite)
File "/usr/lib64/python2.6/subprocess.py", line 1238, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
解决:
[root@localhost ~]# yum install python-setuptools
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.skyshe.cn
* extras: mirrors.skyshe.cn
* updates: mirrors.yun-idc.com
Setting up Install Process
Package python-setuptools-0.6.10-3.el6.noarch already installed and latest version
Nothing to do
[root@localhost ~]# ln -s /usr/local/bin/git /usr/bin/git
[root@localhost ~]# chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
chmod: cannot access `/home/git/repositories/gitosis-admin.git/hooks/post-update': No such file or directory
[root@localhost ~]# find / -name post-update
/opt/git-2.0.0/gitosis/build/lib/gitosis/templates/admin/hooks/post-update
/opt/git-2.0.0/gitosis/gitosis/templates/admin/hooks/post-update
/opt/git-2.0.0/gitosis/gitosis/test/mocktemplates/hooks/post-update
/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/templates/admin/hooks/post-update
[root@localhost ~]# chmod 755 /usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/templates/admin/hooks/post-update
[root@localhost ~]# sudo -H -u git gitosis-init < ~/id_rsa.pub
Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/
Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/