両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン |
github:入門 [2021/08/25 00:12] – [チーム開発によるPull Request] baba | github:入門 [2021/08/26 23:37] – [他人のリポジトリにPull Requestを送る] baba |
---|
</html> | </html> |
| |
| ^ コマンド ^ 説明 ^ |
| | git reset README.md | README.msを一旦 git add してしまった後に「やっぱりやめた」というときに使うコマンドです | |
| | git reset -hard HEAD | ファイルの編集を始めたけど一旦最初の状態に戻したいときはこのコマンド | |
===== Pull Request ===== | ===== Pull Request ===== |
Pull Requestには大きく分けて | Pull Requestには大きく分けて |
すでに共同で開発をする人がいるという前提からスタートします.この開発の場合はAさんが作成したリポジトリをBさんがcloneして,これまで説明したやり方で簡単にAさんが作成したブランチを更新することができます.もっとも簡単な例はmainブランチをBさんが更新してしまうやり方でしょう. | すでに共同で開発をする人がいるという前提からスタートします.この開発の場合はAさんが作成したリポジトリをBさんがcloneして,これまで説明したやり方で簡単にAさんが作成したブランチを更新することができます.もっとも簡単な例はmainブランチをBさんが更新してしまうやり方でしょう. |
| |
| === Aさんが作成したリポジトリのmainブランチにBさんが直接pushする === |
<html> | <html> |
<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/d5499364d9014b35bf14809b7b2bad05" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div> | <div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/d5499364d9014b35bf14809b7b2bad05" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div> |
</html> | </html> |
| |
| === Aさんが作成したリポジトリにBさんがdevという名前のブランチでpushして,Pull Request(mainにマージして頂戴のアピール)を作成して,Aさんがmainにマージするまで === |
<html> | <html> |
<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/d9ad15d486a74b92b05e1fe394374c1a" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div> | <div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/d9ad15d486a74b92b05e1fe394374c1a" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div> |
| </html> |
| ==== 他人のリポジトリにPull Requestを送る ==== |
| このやり方はこれまでの内容とほぼ同じです.唯一違う点は,git cloneから始めるのではなく,対象となるリポジトリをforkすることから始めます.先程のチーム開発と比べて, |
| - PRを送りたいリポジトリをforkする(ブラウザから行う) |
| - forkしたリポジトリをcloneする |
| - cloneしたローカルリポジトリで適当な名前のbranchを切って修正・追加を行う |
| - 変更した内容でforkしたリモートリポジトリにpushする |
| - ブラウザ上のforkしたリモートリポジトリページからpull requestを作成する |
| - 自分のPRをmergeしてもらったら,forkしたリポジトリも本家に合わせてmergeする |
| という流れになります.ではやってみましょう. |
| |
| <html> |
| <div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/0a8146db13144801bc6d722fbbcd558c" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div> |
</html> | </html> |
====== Reference ====== | ====== Reference ====== |
* gitの入門周りのコマンドだけをまとめたページ:https://qiita.com/ay3/items/8d758ebde41d256a32dc | * gitの入門周りのコマンドだけをまとめたページ:https://qiita.com/ay3/items/8d758ebde41d256a32dc |
| |