在许多帐户中使用没有Sudo的Git [英] Using Git without Sudo in many accounts

查看:314
本文介绍了在许多帐户中使用没有Sudo的Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的Ubuntu有很多账户。
创建新账户让Git在没有sudo的情况下无法访问。



我将所有者更改为我,masi和组为 admin masi 所属的位置。
我有以下Git权限

  800 -rwxrwxrwx 1 masi admin 813744 2009-02-20 23:01 / usr / bin / git 

尝试使用Git时出现以下消息

  git status 
致命:无法创建'.git / index.lock':权限被拒绝

我运行 find。 -iregex。* index.l。* 它没有返回任何匹配,所以在锁定系统时似乎没有index.lock,我也用sudo运行同样的命令。如果我正确理解你的问题,你需要授予几个* nix用户帐户对同一个git仓库的写入权限。使用 - share git init 的命令行参数应该启用这个.GitWiki具有关于这个问题要说几句话。这应该可以做到这一点:

  git --bare init --shared =全部

如果您已经创建了存储库,可以通过执行以下命令将其转换为共享存储库:

  git repo-config core.sharedRepository true 



<请参阅在moserei.de的博客文章



2014年更新:
这仍然是可能的,但是,该命令已从repo-config更改为config。

  git config core.sharedRepository true 


How can you use Git without Sudo in multiple accounts in one Ubuntu?

My Ubuntu has many accounts. The creation of new accounts has made Git inaccessible by me without sudo.

I changed the owner to be me, masi, and the group to be admin where the masi belongs to. I have the following permissions for Git

800 -rwxrwxrwx 1 masi admin 813744 2009-02-20 23:01 /usr/bin/git

I get the following message in trying to use Git

git status
fatal: unable to create '.git/index.lock': Permission denied

I run find . -iregex ".*index.l.* which returns no matches so there seems to be no index.lock in locking the system. I run the same command also with sudo unsuccessfully.

解决方案

If I understand your question correctly, you need grant several *nix user accounts write access to the same git repository. Using the --share command line argument for git init should enable this. The GitWiki has a few words to say about this. This should do the trick:

git --bare init --shared=all

If you have already created your repository, you might be able to convert it to a "shared repository" by throwing this command:

git repo-config core.sharedRepository true

in your repository, as mentioned in a blog post at moserei.de.

2014 update: This is still possible but the command has changed from repo-config to config.

git config core.sharedRepository true

这篇关于在许多帐户中使用没有Sudo的Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆