gpt4 book ai didi

linux - 在没有 git 用户的情况下使用 git 服务器

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:03:55 25 4
gpt4 key购买 nike

我有一台只有一个用户的远程 Linux 机器。

我只是在没有 git 用户的情况下在上面设置了 git repos。但是所有教程都建议我使用 git 用户。所以现在我正在使用

git clone user@hostname:/path/to/git/directory/your_project.git 

而不是:

git clone git@hostname:/path/to/git/directory/your_project.git

而且效果很好。

如果我使用 git 帐户,对于每个项目,我必须更改该项目的权限并更改配置以共享目录。

使用设置使用 git 用户是否比在 linux 上使用您的用户帐户有任何优势?

最佳答案

不多,也许是约定俗成 - git 自动化工具和 API 可能需要 git 用户,但我从未遇到过这种情况。

来源:https://git-scm.com/book/en/v1/Git-on-the-Server-The-Protocolshttps://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-git-server-on-a-vps

第二个描述了创建一个 git 用户,然后你得到的 URLs 是 git@服务器:

你基本上做了同样的事情,但使用的是任何用户而不是名为 git 的用户,所以你得到 user@server:

关于linux - 在没有 git 用户的情况下使用 git 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51922025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com