Git:既存のリポジトリを共有サーバーに配置します


0

公式のgitドキュメントの指示に従って、既存のリポジトリを共有サーバーに配置しようとしました。しかし、サーバー上でリポジトリを複製しようとすると、エラーが発生します。誰が私が間違っているのかを見ることができますか?ありがとう。

[ローカルマシン上]

mkdir temp

cd temp

vim test.txt

[insert]some text

[escape]:wq

git init

git add *.*

git commit -m 'First commit.'

cd ..

scp -r temp user@12.345.67.890:/home/user

[サーバー上]

git clone --bare --shared temp temp.git

> Initialized empty Git repository in /home/user/temp.git/

[ローカルマシン上]

git clone ssh://user@12.345.67.890:/home/user/temp.git temp2

> Cloning into 'temp2'...

user@12.345.67.890's password:

> error: object directory /home/user/temp/.git/objects does not exist; check .git/ojects/info/alternates.

> fatal: git upload-pack: cannot find object b85fsdg87sg9sg877sg79s7g79sg7:

> fatal: Could not read from remote repository

> Please make sure you have the correct access rights and the repository exists.
git 

回答:


1

動作する別の方法を次に示します。公式のドキュメンテーションからメソッドを作成できませんでした-約半日試しました

[サーバー上]

$ git init --bare --shared temp.git

[ローカル]

$ cd temp
$ git remote add origin ssh://user@12.345.67.890:/home/user/temp.git
$ git push origin master

$ git clone ssh://user@12.345.67.890:/home/user/temp.git temp2
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.