Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
演習:Gitの操作(基本編) / GitHub Practice Basic
Search
kaityo256
PRO
October 17, 2022
Education
3.4k
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
生成AIとの付き合い方/ How to work with AI
kaityo256
PRO
3
980
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
320
What is XAI?
kaityo256
PRO
0
220
勾配ブースティングと決定木の話 / gradient boosting and decision trees
kaityo256
PRO
7
1.9k
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
17
6.1k
この講義について / 00-setup
kaityo256
PRO
3
570
GitHubによるWebアプリケーションのデプロイ / 07-github-deploy
kaityo256
PRO
2
510
演習:Gitの基本操作 / 04-git-basic
kaityo256
PRO
1
760
演習:Gitの応用操作 / 05-git-advanced
kaityo256
PRO
1
450
Other Decks in Education
See All in Education
CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
signer
PRO
1
3.5k
General Introduction, Composition, Chemistry & Chemical Classes, Biosources, Therapeutic uses and Commercial Application of Secondary Metabolites.
drpoonamkc
0
210
Dronegeografía innovación didáctica y fotogrametría 3D para la enseñanza de la geografía local y la ciudadaniía activa
juanmartin2026
0
60k
Introduction - Lecture 1 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
3.5k
日本における応用言語学・言語教育学これまでとこれから
terasawat
0
190
Session 1 & 2 - Mass Communication
adeputra13
0
290
Web Application Frameworks - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
中小規模私大の教学IRを支えるデータマネジメント ― データ基盤構築の取り組みと実務の現在地 ―
terazawa
0
240
DRONEGEOGRAFÍA: INNOVACIÓN DIDÁCTICA Y FOTOGRAMETRÍA 3D PARA LA COHESIÓN TERRITORIAL Y LA CIUDADANÍA ACTIVA
juanmartin2026
0
60k
Railsチュートリアル × 反転学習の事例紹介
yasslab
PRO
3
190k
Evaluation Methods - Lecture 6 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.7k
2026年度秋学期 統計学 講義の進め方と成績評価について (2026. 9. 28)
akiraasano
PRO
0
260
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.2k
The SEO Collaboration Effect
kristinabergwall1
1
610
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Six Lessons from altMBA
skipperchong
29
4.6k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
GitHub's CSS Performance
jonrohan
1033
470k
What's in a price? How to price your products and services
michaelherold
247
13k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
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