gpt4 book ai didi

windows - 从 Windows 访问本地 git 存储库

转载 作者:可可西里 更新时间:2023-11-01 10:51:22 26 4
gpt4 key购买 nike

我的本​​地 ubuntu 服务器上有 git 存储库(由 gitosis 提供支持)

我想从另一台由 windows xp (msysgit) 驱动的本地计算机访问

我已经在 windows 机器上生成了 rsa key 并发布到 ubuntu 服务器

我将 .ssh/config 文件设置为在 Windows 机器上使用此 key

当我这样做

ssh git@192.168.0.6

这按预期工作,没有密码提示

但是,当我尝试使用 clone 存储库时:

git clone git@192.168.0.6:gitosis-admin

git clone ssh://192.168.0.6/~/gitosis-admin

然后我得到以下错误:

fatal: 'gitosis-admin' does not appear to be git repository

当我尝试使用现有用户帐户进行克隆时,例如用户名为 atom

git clone atom@192.168.0.6:gitosis-admin

这可以按需工作,但不适用于其他 repo 项目

我的 gitosis.conf:

[gitosis]

[group gitosis-admin]

writable = gitosis-admin

members = windows_user atom@atom-desktop

[group team]

writable = another_project

members = @all

所以我的问题是:“问题出在哪里?”我应该更改 gitdaemon 的设置吗?

最佳答案

根据 this tutorial ,甚至可以在开始修改 gitosis.conf 文件之前完成 git clone。
那么,您是否遵循了这些步骤?

Firstly, it will have created a user called "git".
It has full power over the deposits, having in his home directory.

# Useradd-G git-d / home / git-s / bin / bash-m git 

Then we will get the SSH public key, and put in a temporary file as /tmp/cle.pub.
We will then, as root, run these commands:

sudo-H-u git gitosis-init < /tmp/cle.pub 

In this case, we'll run as git, but in addition, we will run into the home of the latter.
The gitosis-init command will initiate the filing by adding the user's public key as the deposit containing Committing configuration.

If successful, you should get a result like this:

 Initialized empty Git repository in. /
Initialized empty Git repository in. /

(Yes, twice!)

And if you view the contents of git home, like magic, it is full of files!

Now we'll change the file permissions.
Indeed, I sometimes noticed it does not change because of rights problems.

sudo chmod 755 /home/git/repositories/gitosis-admin.gif/hooks/post-update 

This being done, I am pleased to announce that Git your server is ready, and it only remains to add your deposits and your users!

Now all configuration is done on your computer via the deposit that we will import at once:

git clone git @ [server address]: gitosis-admin.gif
cd-gitosis admin.gif

关于windows - 从 Windows 访问本地 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1984867/

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