TLDR
git p4 submit
裸のレポでどのように実行しますか? それはどのコマンドラインオプションgit p4 submit
ですか?
長い話
perforce を使用している社内のチームを git に移行したいと考えています。それを実現するために Git-P4 を使用したいと考えています。perforce のセクションを git レポジトリに複製し、それをリモート リポジトリにして、人々がそれを複製し、変更をリモート リポジトリにプッシュし、リモート リポジトリで行われた変更を定期的に perforce に再送信するようにしたいと考えています。 . だから私はこのチュートリアルに従った
http://answers.perforce.com/articles/KB_Article/Git-P4
これは、次のコマンドに要約されます。
git p4 clone //depot/path.to/folder@all folder --bare
それはうまくいきます、そして私のクライアントマシンで私はします
git clone "user1@server:/home/user1/path/to/folder"
それで問題なく表示されるので、テストファイルを編集してから、
git add file
git commit -m 'test'
git push.
それは機能しますが、レポのあるフォルダーにあるリモートレポに戻ります。
git p4 rebase
そして私はこれを得る
git p4 rebase
Performing incremental import into refs/remotes/p4/master git branch
Depot paths: //depot/path.to/folder/
No changes to import!
fatal: This operation must be run in a work tree
Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash.
と
git p4 submit
私にこれを与える:
Perforce checkout for depot path //depot/path.to/folder/ located at /home/user1/path/to/perforce.folder/
Synchronizing p4 checkout...
... - file(s) up-to-date.
fatal: Not a git repository: '.'
Command failed: ['git', 'rev-list', '--no-merges', 'remotes/p4/master..master']
問題は、送信時に git リポジトリをベア リポジトリにできないことです。作業ディレクトリを持つ通常のリポジトリにする必要があります。しかし、そうであれば、なぜ私に--bare
オプションを与えるのでしょうか? オプションを実行している理由--bare
は、それを省略したときに、リモート リポジトリの作業コピーでコミットされていない変更に関する別のエラー セットが発生したためです。しかし、エラーなしで git p4 を送信するにはどうすればよいですか?