0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Windows11】Git 環境構築手順

0
Posted at

1. Git をインストール

PowerShell を開いて、以下のコマンドを実行する。

winget install --id=Git.Git -e

インストールが終わったら、PowerShell を一度閉じて開き直す

うまくいかない場合

winget が使えない場合は、公式サイトからインストーラをダウンロードして実行する。

https://git-scm.com/download/win

インストール中の設定はすべてデフォルトのままで OK。

2. 動作確認

新しく開いた PowerShell で以下を実行。

git --version

git version 2.x.x のように表示されれば OK。

3. 初期設定

自分の名前とメールアドレスを設定する。これはコミットの記録に使われる。

git config --global user.name "自分の名前"
git config --global user.email "自分のメールアドレス"

(例)

git config --global user.name "Asahi Kawanobe"
git config --global user.email "asahi@example.com"

4. デフォルトブランチ名を main に

git config --global init.defaultBranch main

5. 動作確認(コミットまで)

適当な場所に練習用フォルダを作って、コミットまでできるか確認する。

cd Desktop
mkdir git-test
cd git-test
git init

適当なファイルを作成。

"hello" | Out-File hello.txt

コミットする。

git add hello.txt
git commit -m "first commit"

1 file changed, ... のような表示が出れば OK。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?