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?

82 個の Git コマンドをファジー検索できるチートシートを作った

0
Posted at

作ったもの

Git Cheatsheethttps://sen.ltd/portfolio/git-cheatsheet/

スクリーンショット

  • 82 個の Git コマンドを 10 カテゴリに分類
  • ファジー検索(コマンドと説明の両方にマッチ)
  • 日本語 / 英語の説明
  • 「毎日使う」セクションで頻出コマンドをハイライト
  • ワンクリックコピー
  • ターミナル風ダークテーマ

vanilla JS、ゼロ依存、ビルド不要node --test で 29 ケース。

ファジー検索

クエリの全文字が対象文字列に順序通り現れればヒット。隣接していればボーナス:

for (let i = 0; i < t.length && qi < q.length; i++) {
  if (t[i] === q[qi]) {
    if (lastMatchIdx === i - 1) score += 2;
    else score += 1;
    lastMatchIdx = i;
    qi++;
  }
}

「staged」で検索すると git diff --stagedgit reset --soft がヒット。完全一致より柔軟で、タイポにも強い。

10 カテゴリ

セットアップ / ステージング・コミット / ブランチ / マージ・リベース / リモート / 履歴・状態 / 取り消し / スタッシュ / タグ / 高度な操作

シリーズ

100+ 公開ポートフォリオ シリーズの #47 です。

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?