はじめに
サークルにて共同開発を始めてみたのでメモとして残しておきます。
✅ゴール
・共同開発の理解を深める
✅環境
Windows
✅活用教材
ToDoリストを作りながら学習しよう!
✅関連記事
挑戦したこと
コラボレータのリポジトリからフォーク
最新化
ブランチ作成
イシューを立てる
僕はコントリビュータとしてSTEP5~7までを作成。以下STEP7を終えた状態。

プルリク

※Work2の隣に#2と記載すべきだったっぽい。#3でイシューが立ってしまった。。。
調べたこと
✅既にforkしていたリポジトリの更新方法がわからない
状況:今回私はコントリビュータ(意:貢献者)でコラボレータ(意:主催者)の方がリポジトリを更新したので、forkしたブランチを更新したい。
①現状はすっからかん。

②fork元を自分のgithubのリポジトリに設定する。
git remote add root_branch https://github.com/(Fork元のユーザ名)/(フォークしたいリポジトリ.git)
③登録されたか確認
git remote -v
origin https://github.com/chobi1125/vue-joint-lesson.git (fetch)
origin https://github.com/chobi1125/vue-joint-lesson.git (push)
root_branch https://github.com/コラボレータユーザー名/vue-joint-lesson.git (fetch)
root_branch https://github.com/コラボレータユーザー名/vue-joint-lesson.git (push)
④差分をfetch
git fetch root_branch
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 11 (delta 5), reused 10 (delta 5), pack-reused 0
Unpacking objects: 100% (11/11), done.
From https://github.com/コラボレータユーザー名/vue-joint-lesson
* [new branch] master -> root_branch/master
* [new branch] work1 -> root_branch/work1
⑤自身のローカルリポジトリに反映
git merge root_branch/master
反映された!!

⑥リモートブランチにも変更を反映
git push origin master

🙄ローカル上で差分を取ってリモートへプッシュして反映させるのがポイントですね!
✅work2ブランチに最新情報を取得してしまったのでmasterブランチにマージしたい※2回目の更新時
git branch -a // 現在のブランチを確認 >> work2 git checkout master git merge work2
✅新しいブランチを作成してプッシュする
git checkout -b work4 //README.mdをこれに伴い編集 git add . git commit -m "work4ブランチを作成" git push origin work4
✅あえてmasterブランチ外からmasterブランチ外へプルリクしてみる。

気付き
・コントリビュータはマイルストーンが作れない。
・GitHistoryが便利
おわりに
随時追記していきます。
コメントを残す