File tree Expand file tree Collapse file tree 6 files changed +62
-2
lines changed
docs/3-golden-week/10-git Expand file tree Collapse file tree 6 files changed +62
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,66 @@ import CodeBlock from '@theme/CodeBlock';
66import Term from "@site/src /components/Term";
77import OpenInCodeSandbox from "@site/src /components/OpenInCodeSandbox";
88
9- ## Git によるバージョン管理
9+ ::: caution
10+ 以下の文章は macOS か wsl を用いて開発している前提で記述されています。
11+ :::
1012
11- ## GitHub を用いた共同開発
13+ ## GitHub への登録
14+
15+ 1 . [ Github] ( https://github.co.jp ) を開き、右上のサインアップをクリック。
16+ ![ Github home] ( ./pictures/github-home.png )
17+
18+ 2 . 情報を入力する。
19+ ![ create New Account] ( ./pictures/github-signup.png )
20+ ::: caution
21+ Username は、登録後変更できるとはいえ手順が面倒なため、変更しないものとしてよく考えてつけましょう。
22+ :::
23+
24+ 3 . 公開鍵と秘密鍵の作成
25+
26+ Terminal にて以下のコマンドを実行
27+
28+ ```
29+ $ cd ~
30+ $ ssh-keygen -t ed25519
31+ ```
32+ 途中でターミナルの表示画面が止まりますが、user@host:~ $が再度表示されるまで enter で進みます。
33+
34+ 公開鍵が格納されたファイルの中身を表示させるため、以下のコマンドを入力します。
35+
36+ ```
37+ $ cd ~/.ssh
38+ $ cat id_ed25519.pub
39+ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFNwa2O/BIlw+WvisPCrSlM6IS2M2bbCRKNU9G8NYq2L [ユーザー名]@[コンピューター名]
40+ ```
41+ ` ssh-ed25519 AA... ` 2Lの部分をコピーしましょう。これが公開鍵です。
42+
43+ 4 . Github への公開鍵の登録
44+
45+ 登録ページへの移動方法は、` Setting ` > ` SSH and GPG keys ` > ` New SSH key ` と順に移動すればたどり着ける。
46+ ![ add-ssh-key] ( ./pictures/ssh-key-add.png )
47+
48+ 上記のようなページが表示されたら、Title に適切な名前(自分のどの端末かわかるような情報)、Key には先ほどTerminalで表示した公開鍵を入力して登録しましょう。
49+
50+ ## Gitによるファイルのバージョン管理
51+ :::tip ` .gitignore `
52+ ` .gitignore ` ファイルで指定されたファイルはコミットされない。` npm install ` で簡単にダウンロードできて容量が大きいのでバージョン管理するメリットのない ` node_modules ` や、機密情報や環境ごとに異なる情報を含む ` .env ` といったファイルが指定される。
53+ :::
54+
55+ ## おすすめ拡張機能
56+
57+ - Gitlens
58+
59+ コミットの差分などが見やすくなり便利
60+ ![ gitlens] ( ./pictures/gitLens.png )
61+
62+ - Gitglaph
63+
64+ コマンドパレット(Cmd + Shift + P)に Git Graph: View Git Graph (git log)というメニューが出て見やすい
65+
66+ ![ gitGlaph] ( ./pictures/gitGlaph.png )
67+
68+
69+ ### 課題
70+
71+ Todo アプリのソースコードを Github に保存してみましょう。
You can’t perform that action at this time.
0 commit comments