投稿

git checkout と移行先の対応関係

git checkout -> git switch git checkout -b -> git switch -c git checkout HEAD -> git restore git checkout hash(branch) -> git restore --source hash(branch)

Gitで空コミットを作成する

git commit --allow-empty -m "first commit"

GitHub Pull Request - Files changed の差分プレビューを一括で開閉する

Windowsの場合、Altキーを押しながら、任意のファイルの開閉ボタンをクリックする Macの場合、Optionキーを押しながら、任意のファイルの開閉ボタンをクリックする

curlで文字コードがshift_jisであるページにアクセスした際、発生する文字化けを解消する

curl https://example.com/shiftjis | iconv -f SJIS -t UTF8

curlで得られたJSON文字列をフォーマットする

jqにリダイレクトする curl https://example.com/sample.json | jq jqはbrewを利用してインストールする $ brew install jq

WindowsOSのhostsファイルの場所

WindowsOSのhostsファイルのパス C:\windows\system32\drivers\etc\hosts