🍰

ショートカット備忘録

に公開

Macメモ帳のショートカット

強調表示
⌘ Shift e

タイトル( title )
⌘ Shift t

見出し( headline )
⌘ Shift h

VSCode keybindings.json

クリップボードとの比較

{
  "key": "cmd+[Minus]",
  "command": "workbench.files.action.compareWithClipboard"
}

開いているファイルのパスをコピー

{
  "key": "alt+cmd+c",
  "command": "copyFilePath",
  "when": "editorFocus"
}

GitHubのリンクコピー

{
  "key": "cmd+r",
  "command": "gitlens.copyRemoteFileUrlToClipboard"
}

Git

コミット間のコミットを確認

git log 過去のコミットのハッシュ..コミットへのハッシュ --oneline -- ファイルパス

指定したファイルの指定した行に対するコミットを確認する

git log --oneline -L 7,11:ファイルパス 

指定したファイルの指定した行に対するコミットを確認する(最小)

git log --pretty=format:"%h %s %an" --no-patch -L 107,107:ファイルパス

.bashrc

カレントブランチと指定したブランチ間で差分のあるファイル一覧

function gdiff() {
  local branch=${1:-dev}
  git diff --name-only "$branch" HEAD
}

タイムスタンプ付きのブランチ作成

function gitch() {
  local prefix=$1
  local timestamp=$(date +"%Y%m%d-%H%M%S")
  local branch_name="${prefix}_${timestamp}"
  git checkout -b "$branch_name"
}

カレントブランチのスタッシュ一覧

function current_stash() {
  git stash list | grep "$(git branch --show-current)"
}

Discussion