Just do IT

思うは招く

VSCodeですべてのタブをまとめるコマンド

VSCodeでエディタをすべてのタブ(VSCodeでは「エディタ」と呼ぶ)をひとまとめにしたいとき、コマンドパレットを開いて「join」と検索すれば「Join All Editor Groups」というコマンドが見つかるので叩く。

すると複数に画面を分割している場合、すべてがひとまとまりになる。地味に便利なやつ。

git stash pop, apply, dropの違い

特にpopapplyの違いがよくわからなかったので公式ドキュメントを読んだ。

Remove a single stash entry from the list of stash entries.

pop

Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse operation of git stash push. The working directory must match the index. Applying the state can fail with conflicts; in this case, it is not removed from the stash list. You need to resolve the conflicts by hand and call git stash drop manually afterwards.

  • 待避していた変更履歴をstashリストから削除し、作業しているワーキングツリーに戻す

apply

Like pop, but do not remove the state from the stash list. Unlike pop, may be any commit that looks like a commit created by stash push or stash create.

  • 待避していた変更履歴をstashリストから削除せず、作業しているワーキングツリーに戻す

drop

Remove a single stash entry from the list of stash entries.

待避していた変更履歴をstashリストから削除するだけ。ワーキングツリーには変更を戻さない。

結論としては、stashリストから変更を戻したい場合はpopapplyを目的に応じて使い分ければよい。stash listをきれいにしたい場合はdropすればよい。

【GitHub】We noticed your personal access token (classic) will expire in 〜 days メールがきたらどうしたらいいか

パーソナルトークンを再生成しましょう。

Expirationの期間は好きなものを選んでください。regenerate tokenした後に表示されるパスワードをコピーしておいて、git操作時に以下のような表示が出るのでGithubユーザーネームとさっきコピーしたパスワードを貼り付ければパーソナルトークンの更新は完了です。

Username for 'https://github.com':  ユーザーネームをタイプする
Password for 'https://~~~@github.com': パスワードを貼り付けする