作業したこと
Amazon AWS 上の RHEL7 に、git を yum install でインストール
専用にユーザ A を作成(useradd)
git 用のユーザグループ gitgroup を作成(groupadd)し、ユーザ A を gitgroup に所属させた(usermod)
Windows の TeraTerm Pro で、ユーザAとしてログイン(認証は SSH Key。ユーザパスワードなし)
git リポジトリを /var/repository/git/[プロジェクト名].git として作成(cd /var/repository/git; git init --bare [プロジェクト名].git)
gitリポジトリの所属group を gitgroup に変更。アクセス権をユーザのみ書き込み可、グループおよびそれ以外は読み込みのみ(cd /var/repository/git; chgrp -R gitgroup [プロジェクト名].git)
SELinux を無効にしてリブート。
なおこの時点でのリポジトリの状況は以下のとおり。(cd /var/repository/git/[プロジェクト名].git; ls -Z)
drwxr-xr-x. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 branches
-rw-r--r--. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 config
-rw-r--r--. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 description
-rw-r--r--. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 HEAD
drwxr-xr-x. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 hooks
drwxr-xr-x. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 info
drwxr-xr-x. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 objects
drwxr-xr-x. [ユーザA] gitgroup unconfined_u:object_r:var_t:s0 refs
Windows 上の SourceTree で、ローカルのリポジトリを作成
SourceTree でリモートリポジトリ(リポジトリ名:repB)を設定
(ssh://[ユーザA]@[サーバ]/var/repository/git/[プロジェクト名].git)
SourceTree にSSH Key を設定(Pageant にキーをインポート)
発生している問題
この状態でローカルでコミットしてあるプロジェクトを push する。
プッシュ先:リモートリポジトリ
対象:ローカルブランチ master リモートブランチ master
※プッシュのダイアログで、初期状態で「対象」にチェックが入らない&リモートブランチが空白
以下のようにエラーのログが出て、プッシュできない。
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=manager-st push -v --tags --set-upstream [repB] master:master
Pushing to ssh:[ユーザA]@[サーバ名]/var/repository/git/[プロジェクト名].git
Unable to open connection:
Host does not existfatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
何かご助言いただければ幸いです。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。