
クライアントとサーバーの 2 台のマシンがあります。リモート プッシュを使用して、クライアントからサーバーに Git リポジトリを送信したいと考えています。サーバー上で、以下のコマンドを次の順序で実行しました。
mkdir /mnt && cd /mnt
mkdir test.git && cd test.git
sudo git init --bare
クライアントで次のコマンドを実行しました:
mkdir /mnt && cd /mnt
mkdir test.git && cd test.git
sudo git init
sudo git remote add testy ssh://user@server/mnt/test.git
sudo vim testing.txt
sudo git add testing.txt
sudo git commit -m "testing"
sudo git push testy master
これにより、クライアント マシンでエラーが発生します。
fatal: '/mnt/test.git' does not appear to be a git repository. fatal: The remote end hung up unexpectedly.
類似の質問がいくつかありますが、どれも私の問題には対応していません。解決策をそのまま試してみましたが、うまくいきませんでした。これらの回答では問題は解決しないので、これは重複ではありません。これらの問題を解決するための提案はありますか?
答え1
user@server
次のような読み取り/書き込み/実行アクセス権がないと思われます/mnt/test.git
:
$ sudo sh -c 'cd $(mktemp -d) && git init --bare'
Initialized empty Git repository in /tmp/tmp.TNLcXTZQcN/
$ cd $(mktemp -d)
$ git remote add /tmp/tmp.TNLcXTZQcN
fatal: Not a git repository (or any parent up to mount point /tmp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).