Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
演習:Gitの操作(応用編) / GitHub Practice Advanced
Search
kaityo256
PRO
October 22, 2021
Education
2
1.4k
演習:Gitの操作(応用編) / GitHub Practice Advanced
物理情報工学ソフトウェア開発演習
kaityo256
PRO
October 22, 2021
Tweet
Share
More Decks by kaityo256
See All by kaityo256
モンテカルロ法(3) 発展的アルゴリズム / Simulation 04
kaityo256
PRO
7
1.4k
UMAPをざっくりと理解 / Overview of UMAP
kaityo256
PRO
5
2.2k
SSH公開鍵認証による接続 / Connecting with SSH Public Key Authentication
kaityo256
PRO
4
520
論文紹介のやり方 / How to review
kaityo256
PRO
15
84k
デバッグの話 / Debugging for Beginners
kaityo256
PRO
12
1.6k
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
8
570
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
15
5.3k
制限ボルツマンマシンの話 / Introduction of RBM
kaityo256
PRO
3
1.3k
論文の読み方 / How to survey
kaityo256
PRO
223
180k
Other Decks in Education
See All in Education
GitHubとAzureを使って開発者になろう
ymd65536
1
150
[FUN Open Campus 2025] 何でもセンシングしていいですか?
pman0214
0
220
Interaction - Lecture 10 - Information Visualisation (4019538FNR)
signer
PRO
0
2k
CHARMS-HP-Banner
weltraumreisende
0
480
AI for Learning
fonylew
0
180
Linuxのよく使うコマンドを解説
mickey_kubo
1
250
View Manipulation and Reduction - Lecture 9 - Information Visualisation (4019538FNR)
signer
PRO
1
2.1k
2025年度春学期 統計学 第6回 データの関係を知る(1)ー相関関係 (2025. 5. 15)
akiraasano
PRO
0
170
JOAI2025講評 / joai2025-review
upura
0
380
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
1.8k
登壇未経験者のための登壇戦略~LTは設計が9割!!!~
masakiokuda
3
620
万博マニアックマップを支えるオープンデータとその裏側
barsaka2
0
550
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Six Lessons from altMBA
skipperchong
28
3.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Done Done
chrislema
185
16k
Agile that works and the tools we love
rasmusluckow
329
21k
BBQ
matthewcrist
89
9.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Adopting Sorbet at Scale
ufuk
77
9.5k
4 Signs Your Business is Dying
shpigford
184
22k
Optimizing for Happiness
mojombo
379
70k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Transcript
1 29 演習:Gitの操作(応用編) 慶應義塾大学理工学部物理情報工学科 渡辺 物理情報工学ソフトウェア開発演習
2 29 • git amendによりコミットが変更されることを確認する • git mergeの衝突を解決する • git
rebaseにより歴史を改変する • git rebaseの衝突を解決する • git bisectを使ってみる
3 29 リポジトリのクローン ディレクトリの作成 github cd mkdir github cd github
git clone https://github.com/appi-github/amend-sample.git cd amend-sample ホームディレクトリに移動してから githubディレクトリを作成 github amend-sample ホームディレクトリ Git管理された ディレクトリ ここがカレントディレクトリに
4 29 git log --oneline initial commit updates README.md updates
README.md updaets README.md main HEAD 歴史の確認
5 29 コミットの保存 initial commit updates README.md updates README.md updaets
README.md main HEAD original_main git branch original_main 現在のコミットに別名をつけておく
6 29 コミットメッセージの修正 git commit --amend -m "updates README.md" initial
commit updates README.md updates README.md updaets README.md main HEAD original_main updates README.md
7 29 git log --oneline 歴史の確認 initial commit updates README.md
updates README.md updates README.md main HEAD 修正されていることを確認
8 29 git log --all --graph --oneline 歴史が分岐したことを確認 initial commit
updates README.md updates README.md updaets README.md main HEAD original_main updates README.md
9 29 リポジトリのクローン cd cd github git clone https://github.com/appi-github/merge-sample.git cd
merge-sample github merge-sample ここがカレントディレクトリに
10 29 ブランチの作成 git branch knock origin/knock main HEAD knock
ブランチの確認 git branch -vva main HEAD origin/knock origin/knock origin/knockの指すコミットに knockブランチを作成
11 29 差分確認 main HEAD knock git diff knock poetry.txt
poetry.txt コミット間を比較 ここに差分を検出
12 29 マージ main HEAD knock 衝突 git merge knock
マージの中断 git merge --abort main HEAD knock このプロセスでpoetry.txtが どのように変化したか調べる
13 29 マージ git merge knock main HEAD knock 衝突
衝突の解決とコミット git add poetry.txt git commit -m "knock" potery.txtをエディタで修正
14 29 main HEAD knock git log --all --graph --oneline
マージされた「歴史」を確認
15 29 リポジトリのクローン cd cd github git clone https://github.com/appi-github/rebase-history-sample.git cd
rebase-history-sample github rebase-history-sample ここがカレントディレクトリに
16 29 二人が目を覚ます アイスがまだある アイスが消えた ボブが登校 歴史の確認 git log --oneline
17 29 ブランチの作成 git branch start origin/start 二人が目を覚ます アイスがまだある アイスが消えた
ボブが登校 main HEAD knock 歴史改変の起点にする
18 29 歴史改変 git rebase -i start
19 29 改変された歴史の確認 git log --oneline 二人が目を覚ます アイスがまだある アイスが消えた ボブが登校
20 29 リポジトリのクローン cd cd github git clone https://github.com/appi-github/rebase-conflict-sample cd
rebase-conflict-sample github rebase-conflict-sample ここがカレントディレクトリに
21 29 main HEAD branch origin/branch ブランチの準備 git switch -c
branch origin/branch origin/branchの指すコミットにbranchというブランチを作成し、 カレントブランチをそこへ移動
22 29 歴史の確認 git log --all --graph --oneline main HEAD
branch m1 m2 m3 f1 f2 f3
23 29 リベースの実行 git rebase main main HEAD branch
24 29 main m1 m2 m3 f1 f2 f3 f1’
f2’ f3’ 状態の確認 git status HEAD HEADは「最後にリベースがうまくいったコミット」を指している (detached HEAD)
25 29 main m1 m2 m3 f1 f2 f3 f1’
f2’ f3’ HEAD エディタで衝突状態にあるファイル「text1.txt」を修正し、保存する
26 29 解決をGitに伝える git add text1.txt git commit -m "f2"
main m1 m2 m3 f1 f2 f3 f1’ f2’ f3’ HEAD Gitが自動で作ることができなかった このコミットを手動で作った
27 29 リベースの続行 git rebase --continue main m1 m2 m3
f1’ f2’ f3’ HEAD branch リベースが最後まで実行され、detached HEAD状態が解消される
28 29 歴史の確認 git log --oneline --graph main m1 m2
m3 f1’ f2’ f3’ HEAD branch もともと分岐していた歴史が一本道になり、 mainからbranchへfast-forwardマージが可能になった
29 29 git bisectを使った犯人捜し