-
Goal
類似アプリを作成する必要があり、Cloud Source Repositoriesのソースを別プロジェクトのレポジトリにコピーしたい。
開発は、cloud shell 上で行っているので、そこでコピーする -
How
元のプロジェクト名: s001
新しいプロジェクト名: s002 とする
-
プロジェクトs002 に、新しいRepositoryを作成 --- GCPのコンソールで作成
-
以下、Cloud Shell上での作業
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters#1 空のレポジトリをクローンする gcloud source repos clone <NEW REPOSITORY NAME> --project=s002 cd <NEW REPOSITORY NAME> #2 コピーしたいレポジトリをRemoteに temp という名前として追加 git remote add temp https://source.developers.google.com/p/s001/r/<OLD REPOSITORY NAME> #3 LOCALにプルする この場合は、MasterとしてPULLしている git pull temp master #4 変更して、コミット git add . git commit -m "initial commit" #5 Remoteを削除 git remote remove temp #6 push する git push origin master
- 参考情報
レポへのリンクは以下から取れる - 編集後記
Cloud ShellとCloud Source Repositories に、加えてCloud Buildで、色々できるようになりたいが、まだ、調べるのに時間がかかりすぎ。。。
0 件のコメント:
コメントを投稿