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 Basic
Search
kaityo256
PRO
October 17, 2022
Education
3.3k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
演習:Gitの操作(基本編) / GitHub Practice Basic
物理情報工学ソフトウェア開発演習
kaityo256
PRO
October 17, 2022
More Decks by kaityo256
See All by kaityo256
What is XAI?
kaityo256
PRO
0
150
勾配ブースティングと決定木の話 / gradient boosting and decision trees
kaityo256
PRO
7
1.8k
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
6k
この講義について / 00-setup
kaityo256
PRO
2
500
GitHubによるWebアプリケーションのデプロイ / 07-github-deploy
kaityo256
PRO
2
410
演習:Gitの基本操作 / 04-git-basic
kaityo256
PRO
1
640
演習:Gitの応用操作 / 05-git-advanced
kaityo256
PRO
1
370
演習:GitHubの基本操作 / 06-github-basic
kaityo256
PRO
1
470
バージョン管理とは / 01-a-vcs
kaityo256
PRO
2
450
Other Decks in Education
See All in Education
Dashboards - Lecture 11 - Information Visualisation (4019538FNR)
signer
PRO
1
2.8k
Examen de Selectividad. Geografía junio 2026 (Convocatoria Ordinaria). UCLM
juanmartin2026
1
5.5k
Fundamentos, Caracteristicas y Aplicaciones de los Modulos NumPy , Matplotlib y Pandas
robintux
0
220
Course Review - Lecture 13 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
2.4k
AIの力を100%引き出すために
frievea
0
430
Lectura 2 (PIT : Python Basico)
robintux
0
420
Visionary Initiative: Future Intelligence — Laying the foundations for the future of science, intelligence, and society | Science Tokyo
sciencetokyo
PRO
0
250
Visionary Initiative: Materials-Positive Society 「モノの進化をポジティブな社会の原動力に」|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
1.1k
Geografía y fútbol. Atlanta. la megalópolis del fútbol
juanmartin2026
1
12k
Visionary Initiative: Materials-Positive Society — Evolving “Things,” empowering a positive society | Science Tokyo
sciencetokyo
PRO
0
210
2026年度春学期 統計学 第8回(オンデマンド配信回) 演習(1)・問題に対する答案の書き方 (2026. 5. 21)
akiraasano
PRO
0
190
NDIAS Automotive / IoT CTF 2026 Recap - Keyfob & OSINT
himitu23
0
310
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
From π to Pie charts
rasagy
0
330
GitHub's CSS Performance
jonrohan
1033
470k
Optimizing for Happiness
mojombo
378
71k
Designing for Performance
lara
611
70k
Skip the Path - Find Your Career Trail
mkilby
1
200
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
500
Typedesign – Prime Four
hannesfritz
42
3.1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
800
Transcript
1 30 演習:Gitの操作(基本編) 慶應義塾大学理工学部物理情報工学科 渡辺 物理情報工学ソフトウェア開発演習
2 30 • Gitの初期設定を行う • コマンドラインでGitの操作を一通り確認する • VSCodeからもGitの操作ができることを確認する
3 30 1. 検索ボックスにgit bashと入力 2. 表示された「Git Bash」をクリック
4 30 Git Bashを開くと、以下のような画面となる $マークの右にカーソルが点滅しており、コマンド入力待ちになる このマークをコマンドプロンプト(もしくは単にプロンプト)と呼ぶ
5 30 Git Bashは、デフォルトでカレントディレクトリとカレントブランチを 表示する Git Bashを開いた直後は「ホームディレクトリ」がカレントディレクトリに なっている (PC室の環境では/z/になっているはず) 「cd
github」コマンドにより、カレントディレクトリをgithubに移動すると 右の表示が変わる(/z/githubになるはず)
6 30 Git Bashは、カレントディレクトリがGitリポジトリでない場合は カレントディレクトリしか表示しない カレントディレクトリがGitリポジトリの場合は、カレントブランチを表示する プロンプト表示により「カレントディレクトリ」と「カレントブランチ」を 常に確認すること
7 30 初期設定 git config --global user.name "ユーザー名" git config
--global user.email "メールアドレス“ git config --global core.editor vim git config --global core.autocrlf false git config --global init.defaultBranch main git config --global alias.st "status -s" ホームディレクトリ .gitconfig 上記設定は、ホームディレクトリ直下の .gticonfigに書き込まれる Gitに名前やアドレス、その他設定を伝える
8 30 cd mkdir git cd git ディレクトリの作成 git ホームディレクトリに移動してから
gitディレクトリを作成し、そこへ移動 カレント ディレクトリ mkdir test cd test さらにtestディレクトリを作成して そこへ移動 git test
9 30 1. 検索ボックスにvs codeと入力 2. 表示された「Visual Studio Code」をクリック
10 30 初回起動時の「日本語化パッケージをインストールして再起動」という 表示が出たら、クリックしてインストールする フォルダの開き方 「ファイル」から「フォルダーを開く」を選択 「このフォルダー内のファイルの作成者を 信頼しますか?」という表示が出たら 「はい、作成者を信頼します」を選ぶ
11 30 PCをクリック
12 30 ネットワークの場所(Z:)をクリック
13 30 「git」をダブルクリック
14 30 「test」をシングルクリック 「test」が選択された状態で「フォルダーの選択」をクリック
15 30 README.mdファイルの作成 git test README.md
16 30 1 2 1. ファイルの新規作成ボタンを押して 2. 「README.md」と入力
17 30 ファイル内容を入力したら保存すること ファイル名のタブの隣のアイコンが「•」だと未保存 ファイル名のタブの隣のアイコンが「X」だと保存済み Ctrl+S もしくは 「ファイル」の 「保存」をクリック
18 30 リポジトリの初期化 git init git test README.md .git .gitディレクトリが作られ、
testがgit管理下に入る
19 30 インデックスへの追加 git add README.md README.md README.md ワーキングツリー インデックス
リポジトリ ワーキングツリーからインデックスにファイルをコピー
20 30 コミット git commit -m "initial commit" README.md README.md
ワーキングツリー インデックス リポジトリ README.md インデックスの状態をそのまま「歴史」としてリポジトリに保存
21 30 README.md README.md ワーキングツリー インデックス リポジトリ README.md ファイルの修正 ワーキングツリーが、インデックス、リポジトリと異なる状態になる
22 30 README.md README.md ワーキングツリー インデックス リポジトリ README.md インデックスへの追加 git
add README.md ワーキングツリーからインデックスにファイルをコピー
23 30 コミット git commit -m "adds new line" インデックスの状態をそのまま「歴史」としてリポジトリに保存
README.md README.md ワーキングツリー インデックス リポジトリ README.md
24 30 ファイルの修正 ワーキングツリーが、インデックス、リポジトリと異なる状態になる README.md README.md ワーキングツリー インデックス リポジトリ README.md
25 30 コミット(自動ステージング) git commit -am "modifies README.md" README.md README.md
ワーキングツリー インデックス リポジトリ README.md commit -a オプションにより、修正のあるファイル全てを 自動でステージングしてからコミットする (ステージングを飛ばしているわけではない)
26 30 歴史の確認 git log git log --oneline main HEAD
initial commit adds new line modifies README.md ターミナルに表示された情報から 「玉と線」を頭の中に再構成すること
27 30 VSCodeからのコミット git add README.md この「+」ボタンがgit addに対応 1 2
28 30 git commit –m ”commit from VSCode” コミットボタン ここにコミットメッセージが
書ける
29 30 もしコミットメッセージを書き忘れてコミットボタンを押したら COMMIT_EDITMSGというファイルが開く 一番上に「commit from VSCode」と入力する 保存してからファイルを閉じる
30 30 main HEAD initial commit adds new line modifies
README.md commit from VSCode 歴史の確認 git log --oneline