LoginSignup
1
0

More than 1 year has passed since last update.

Mac購入後のプログラミング準備

Posted at

はじめに

プログラミング学習中の@kat_logと申します。

M2マックに買い替えまして、自分が行った初期設定(プログラミング関係)になります!

image.png

VSCodeインストール

まずは必要ですね!

Homebrewインストール

インストールコマンド

下記コマンドでインストールできます(公式サイトのトップページにあります)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

インストール後にコマンド2つ実行

上記インストールコマンド後に表示されている通りコマンド2つを実行します

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/yamadatarou/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

うまくインストールできたか確認

brew helpコマンドが使えるかで確認します
以下のような感じで表示されればOKです

% brew help
Example usage:
  brew search TEXT|/REGEX/
  brew info [FORMULA|CASK...]
  brew install FORMULA|CASK...
 〜以下省略〜

gitアップデート

ローカルのgitバージョン確認

% git --version
git version 2.32.1 (Apple Git-133)

最新バージョン確認

公式サイトのトップページに載っています

gitアップデート

下記コマンドで可能です

brew install git
brew upgrade git

git初期設定

名前・メールアドレス設定

% git config --global user.name "なまえ(ニックネーム)"
% git config --global user.email "メアド"

やっておかないと、端末にて初めてコミットする時に以下のように怒られます↓

% git commit -m "first commit"
Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

デフォルトブランチ名をmainに変更

% git config --global init.defaultBranch main

確認

下記ファイルに書き込まれるので確認できます
(ホームディレクトリ直下の.gitconfigファイル)

~/.gitconfig

ターミナルのカスタマイズ

llコマンドのエイリアス設定

% vi ~/.zshrc

上記コマンドにてzshの設定ファイルを開き、(新規作成)

# llコマンド
alias ll='ls -lahFG'

と書き込み、保存する(:wq

オプション 意味
l 長い形式で表示
a 隠しファイルも表示
h ファイルサイズを読みやすく表示(KB、MBなど)
F 実行ファイルに*、ディレクトリに/を表示
G 色付き表示、グループ非表示

おわりに

お読みいただきありがとうございました!
どなたかの参考になれば嬉しいです😆

1
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
1
0