私は数日間gitとgerritについて学ぼうとしていますが、適切な解決策が見つからないというエラーがあります。エラーメッセージは次のとおりです。
*asfaa@asadaf:~/test$ git review -R
Could not connect to gerrit.
Enter your gerrit username: remote0
Trying again with ssh://<username>@<ip>:29418/test
Creating a git remote called "gerrit" that maps to:
ssh://<username>@<ip>:29418/test
This repository is now set up for use with git-review. You can set the
default username for future repositories with:
git config --global --add gitreview.username "remote0"
Your change was committed before the commit hook was installed.
Amending the commit to add a gerrit change id.
remote: Processing changes: refs: 1, done
To ssh://<username>@<ip>:29418/test
! [remote rejected] HEAD -> refs/publish/master (no common ancestry)
error: failed to push some refs to 'ssh://<username>@<ip>:29418/test'*
以下の手順の後にこのエラーが発生します。
- コマンド「ssh -p 29418 user@localhost gerrit create-project project_name」で gerrit フォルダーを作成します。
- 次に、ホームディレクトリに同じフォルダーを作成し、「git init」コマンドで git リポジトリに変換します。
- 次に、プッシュしたいプロジェクトのすべてのコンテンツをこのフォルダーの gerrit リポジトリにコピーし、「git add --all」コマンドを使用してすべての変更を新しい変更として追加します。
- .gitreview ファイルを作成し、ホストとプロジェクトの属性を入れます。
- 私の変更をコミットします。
- 最後に、「git review -R」コマンドを使用して、変更内容を gerrit リポジトリに送信し、レビューします。
ここで、最後のステップで、このコマンドgit push ssh://[username]@[ip]:29418/project_name
を使用すると機能します。ただし、この場合、レビューを行わずに直接 git にプッシュするため、gerrit リポジトリを使用しても意味がありません。さらに、後でこのプロジェクトを別のコンピューターに複製し、変更を gerrit リポジトリに送信するときに、このエラーに対処する必要があると思います。
前もって感謝します