WindowsでAIプログラミング

Git & GitHub

Git

Gitのインストール

https://git-scm.com/ からwindows用をダウンロードし、インストール。

バージョンの確認

git –version

エディタを『Visual Studio Code』を設定する

git config –global core.editor “code –wait”

設定を確認する

git config core.editor

リポジトリの作成

git init

コミットの作成

ステージングエリアに変更を登録する

git add

コミットを作成する

git commit

Git管理下のファイルやディレクトリを削除する

git rm

※オプションに『-r』を使用すると、ディレクトリ内のファイルも削除する

状態の確認

ローカルリポジトリの状態を確認する

git status

各エリアの差分を確認する

git diff

コミットの履歴を確認する

git log

状態の復元

ワークツリーの変更を取り消す

git checkout

ステージングエリアに追加した変更をワークツリーへ戻す

git reset

GitHubリポジトリからローカルリポジトリに取得する

git clone 『githubのurl』

GitHub

SSH Keyを作成する

ssh-keygen -t rsa

※ファイルは、『.ssh』に保存する