Skip to content

Latest commit

 

History

History
590 lines (436 loc) · 23 KB

File metadata and controls

590 lines (436 loc) · 23 KB

Git ID Switcher

⚠️ アイヌ イタㇰ翻訳について

この翻訳は実験的なものであり、誤りを含む可能性があります。 ネイティブスピーカーの方からの修正PRを心よりお待ちしています。

タン ウコイタㇰ ウタㇻ オロワ コㇿカㇺ アン ルウェ ネ。 ピㇼカ ウタㇻ オロワ アイヌ イタㇰ ウコイタㇰ エラマン クㇽ エアㇻキ。


📚 アイヌ イタㇰについて学ぶ / Learn More About Ainu

アイヌ語(アイヌ イタㇰ)は、日本の北海道・樺太・千島列島で話されてきた言語です。現在はユネスコにより「極めて深刻な危機」に分類されていますが、復興の取り組みが進められています。


Git ID Switcher シネㇷ゚ クリㇰ オロワ Git ID ウコイタㇰ ウタㇻ ホㇱキノ エトゥㇾ。GitHub アカウント、SSH キー、GPG サイン オロワノ ウコイタㇰ、Git Submodule オロワノ ID ウコイタㇰ

VS Code Marketplace Open VSX Registry License: MIT OpenSSF Scorecard OpenSSF Best Practices SLSA 3 Security CI Platform codecov Quality Gate Status Harden-Runner Karesansui Architecture
26 Languages 🇺🇸 🇯🇵 🇨🇳 🇹🇼 🇰🇷 🇩🇪 🇫🇷 🇪🇸 🇧🇷 🇮🇹 🇷🇺 🇵🇱 🇹🇷 🇨🇿 🇭🇺 🇧🇬 🇺🇦 🌍 🌺 🐻 🐉 🖖 🐱 🏴‍☠️ 🎭

Demo

🎯 ネーン クス タン Extension?

Git ID ウコイタㇰ Extension ポㇿ アン、Git ID Switcher ウタㇻ オㇿケ ピㇼカノ:

  1. Submodule: submodule アン repository オロワ、シネㇷ゚ シネㇷ゚ git config user.name エキ クス ネ。タン extension オロワ submodule オㇿ ID ウコイタㇰ。
  2. SSH & GPG: レー エトゥㇾ アイヌ、SSH キー ウン GPG サイン エキ。

ピㇼカ ウタㇻ (Features / 機能)

  • Submodule: Git submodule オロワノ ID ウコイタㇰ
  • SSH キー ウコイタㇰ: ssh-agent オロワ SSH キー ウコイタㇰ
  • GPG サイン: commit サイン GPG キー (オプション)
  • シネㇷ゚ クリㇰ オロワ ID ウコイタㇰ: Git user.name ウン user.email ホㇱキノ エトゥㇾ
  • ステータスバー: エネアン ID エヌカㇻ
  • ツールチップ: ID ウタㇻ オロワ
  • macOS, Linux, Windows: オㇿ ケウトゥㇺ
  • 17 イタㇰ: ウコイタㇰ ウタㇻ

🌏 イタㇰ ウタㇻ オロワ

ポン ウタㇻ オロワノ ピㇼカ アン。 ポンノ アン クス ホㇱキ エヤㇺ シㇼ ソモ キ。 ピㇼカノ ウコイタㇰ エアㇻキ シㇼ ソモ ネ ヤㇰカ、ポン イタㇰ オロワ ピㇼカノ エヌカㇻ クス エラㇺ。

タン extension オロワ VSCode 17 イタㇰ オㇿ。README オロワ、ポン イタㇰ ウン ホㇱキㇷ゚ イタㇰ オロワノ。


ホㇱキノ (Quick Start / クイックスタート)

ウタㇻ アカウント ウン モノレ アカウント (Enterprise Managed User) ウコイタㇰ。

1: SSH キー

SSH キー エキ (アン ヤㇰカ エレㇷ゚):

# ウタㇻ (Personal / 個人用)
ssh-keygen -t ed25519 -C "sisam@personal.example.com" -f ~/.ssh/id_ed25519_personal

# モノレ (Work / 仕事用)
ssh-keygen -t ed25519 -C "sisam@company.example.com" -f ~/.ssh/id_ed25519_work

シネㇷ゚ シネㇷ゚ 公開鍵 (.pub ファイル) GitHub アカウント オロワ。

ウタㇻ: GitHub オロワ id_ed25519_personal.pub (公開鍵)。id_ed25519_personal (拡張子ナシ) 秘密鍵—ホㇱキ アン ソモ キ。

2: SSH Config

~/.ssh/config エトゥㇾ:

# ウタㇻ アカウント
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_personal
    IdentitiesOnly yes

# モノレ アカウント
Host github-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_work
    IdentitiesOnly yes

3: Extension

Extension 設定 (Cmd+, / Ctrl+,) → "Git ID Switcher" エヌカㇻ → "settings.json エトゥㇾ" クリㇰ:

{
  "gitIdSwitcher.identities": [
    {
      "id": "personal",
      "name": "シサㇺ",
      "email": "sisam@personal.example.com",
      "service": "GitHub",
      "icon": "🏠",
      "description": "ウタㇻ プロジェクト",
      "sshKeyPath": "~/.ssh/id_ed25519_personal"
    },
    {
      "id": "work",
      "name": "シサㇺ",
      "email": "sisam@company.example.com",
      "service": "GitHub モノレ",
      "icon": "💼",
      "description": "モノレ",
      "sshKeyPath": "~/.ssh/id_ed25519_work",
      "sshHost": "github-work"
    }
  ],
  "gitIdSwitcher.defaultIdentity": "personal",
  "gitIdSwitcher.autoSwitchSshKey": true,
  "gitIdSwitcher.applyToSubmodules": true
}

4: エキ!

  1. ステータスバー ID アイコン クリㇰ (ハヨㇰペ シㇼペ)
  2. ID エトゥㇾ
  3. オㇿケ! Git config ウン SSH キー ウコイタㇰ。

Quick Pick

SSH Host エイリアス

Repository クローン、ID オロワ Host エキ:

# モノレ ID (github-work エイリアス)
git clone git@github-work:company/repo.git

# ウタㇻ ID (github.com デフォルト)
git clone git@github.com:sisam/repo.git

オプション: GPG サイン

GPG オロワ commit サイン:

1: GPG キー ID エヌカㇻ

gpg --list-secret-keys --keyid-format SHORT

例:

sec   ed25519/ABCD1234 2024-01-01 [SC]
      ...
uid         [ultimate] シサㇺ <sisam@personal.example.com>

キー ID ABCD1234

2: GPG キー ID オロワ

{
  "gitIdSwitcher.identities": [
    {
      "id": "personal",
      "name": "シサㇺ",
      "email": "sisam@personal.example.com",
      "service": "GitHub",
      "icon": "🏠",
      "description": "ウタㇻ プロジェクト",
      "sshKeyPath": "~/.ssh/id_ed25519_personal",
      "gpgKeyId": "ABCD1234"
    }
  ]
}

タン ID ウコイタㇰ、extension エキ:

  • git config user.signingkey ABCD1234
  • git config commit.gpgsign true

例: 4 アカウント SSH + GPG

オㇿ 例:

SSH Config (~/.ssh/config)

# ウタㇻ アカウント (デフォルト)
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_personal
    IdentitiesOnly yes

# モノレ アカウント
Host github-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_work
    IdentitiesOnly yes

# Bitbucket アカウント
Host bitbucket.org
    HostName bitbucket.org
    User git
    IdentityFile ~/.ssh/id_ed25519_bitbucket
    IdentitiesOnly yes

Extension 設定

{
  "gitIdSwitcher.identities": [
    {
      "id": "personal",
      "name": "シサㇺ",
      "email": "sisam@personal.example.com",
      "service": "GitHub",
      "icon": "🏠",
      "description": "ウタㇻ プロジェクト",
      "sshKeyPath": "~/.ssh/id_ed25519_personal",
      "gpgKeyId": "PERSON12"
    },
    {
      "id": "work",
      "name": "シサㇺ",
      "email": "sisam@company.example.com",
      "service": "GitHub モノレ",
      "icon": "💼",
      "description": "モノレ アカウント",
      "sshKeyPath": "~/.ssh/id_ed25519_work",
      "sshHost": "github-work",
      "gpgKeyId": "WORK1234"
    },
    {
      "id": "bitbucket",
      "name": "シサㇺ",
      "email": "sisam@bitbucket.example.com",
      "service": "Bitbucket",
      "icon": "🪣",
      "description": "Bitbucket プロジェクト",
      "sshKeyPath": "~/.ssh/id_ed25519_bitbucket",
      "sshHost": "bitbucket.org"
    },
    {
      "id": "sirokan",
      "name": "シサㇺ",
      "email": "sisam@freelance.example.com",
      "service": "GitLab",
      "icon": "🎯",
      "description": "シㇿカン プロジェクト"
    }
  ],
  "gitIdSwitcher.defaultIdentity": "personal",
  "gitIdSwitcher.autoSwitchSshKey": true,
  "gitIdSwitcher.applyToSubmodules": true
}

ウタㇻ: ホㇱキ ID (sirokan) SSH ソモ—Git config ウコイタㇰ ワノ。GitLab アカウント エネアン commit ウタㇻ オロワ。


設定 リファレンス (Configuration Reference)

ID プロパティ (Identity Properties)

プロパティ 必須 ウコイタㇰ
id ユニーク ID (例: "work", "personal")
name Git user.name — commit オロワ
email Git user.email — commit オロワ
icon ステータスバー 絵文字 (例: "🏠")。シネㇷ゚ 絵文字 ワノ
service サービス レー (例: "GitHub", "GitLab")。UI オロワ
description ピッカー ウン ツールチップ オロワ
sshKeyPath SSH 秘密鍵 パス (例: "~/.ssh/id_ed25519_work")
sshHost SSH config ホスト エイリアス (例: "github-work")
gpgKeyId GPG キー ID commit サイン

表示制限 (Display Limitations)

  • ステータスバー: ~25 文字 ... オロワ
  • icon: シネㇷ゚ 絵文字 (grapheme cluster) ワノ。ポㇿ 絵文字 ロングテキスト ソモ キ

設定 (General Settings)

設定 デフォルト ウコイタㇰ
gitIdSwitcher.identities 例 エヌカㇻ ID 設定 リスト
gitIdSwitcher.defaultIdentity 例 エヌカㇻ デフォルト ID
gitIdSwitcher.autoSwitchSshKey true SSH キー ウコイタㇰ
gitIdSwitcher.showNotifications true ウコイタㇰ 通知
gitIdSwitcher.applyToSubmodules true Git submodule ID ウコイタㇰ
gitIdSwitcher.submoduleDepth 1 ネスト submodule 深さ (1-5)
gitIdSwitcher.includeIconInGitConfig false 絵文字 icon Git config user.name オロワ
gitIdSwitcher.logging.fileEnabled false 監査ログ ファイル オロワ(ID ウコイタㇰ、SSH 操作 等)
gitIdSwitcher.logging.filePath "" ログファイル パス(例:~/.git-id-switcher/security.log)。空 = デフォルト
gitIdSwitcher.logging.maxFileSize 10485760 ローテーション前 最大ファイルサイズ(バイト、1MB-100MB)
gitIdSwitcher.logging.maxFiles 5 保持 ローテーションファイル 最大数(1-20)
gitIdSwitcher.logging.level "INFO" ログレベル:DEBUG/INFO/WARN/ERROR/SECURITY。選択レベル以上 記録
gitIdSwitcher.logging.redactAllSensitive false ウコイタㇰ、タント ウン コラムパコロ マスク(最大プライバシー)
gitIdSwitcher.commandTimeouts {} コマンド タイムアウト(ミリ秒、1秒-5分)。例:{"git": 15000, "ssh-add": 10000}

includeIconInGitConfig オロワ

icon フィールド 設定 動作:

動作
false (デフォルト) icon エディタ UI ワノ。name ワノ Git config オロワ
true icon + name Git config オロワ。絵文字 commit 履歴 オロワ

例: icon: "👤", name: "シサㇺ"

includeIconInGitConfig Git config user.name Commit サイン
false シサㇺ シサㇺ <email>
true 👤 シサㇺ 👤 シサㇺ <email>

ウタㇻ: 基本設定 (SSH ソモ)

SSH キー ウコイタㇰ ソモ (例、GitHub アカウント エネアン commit ウタㇻ オロワ)、ポン 設定 エキ:

{
  "gitIdSwitcher.identities": [
    {
      "id": "personal",
      "name": "シサㇺ",
      "email": "sisam@personal.example.com",
      "icon": "🏠",
      "description": "ウタㇻ プロジェクト"
    },
    {
      "id": "work",
      "name": "シサㇺ",
      "email": "sisam@company.example.com",
      "icon": "💼",
      "description": "モノレ"
    }
  ]
}

タン 設定 git config user.name ウン user.email ワノ ウコイタㇰ。


エキ (How It Works)

Git Config 構造 (Git Config Layer Structure)

Git config 3 レイヤー; ハヨㇰペ レイヤー リㇰンペ オロワ:

システム (/etc/gitconfig)
    ↓ オロワ
グローバル (~/.gitconfig)
    ↓ オロワ
ローカル (.git/config)  ← コㇿケㇷ゚

Git ID Switcher --local (repository ローカル) オロワ。

タン ウタㇻ:

  • ID シネㇷ゚ シネㇷ゚ repository .git/config ファイル オロワ
  • シネㇷ゚ シネㇷ゚ repository エネアン ID オロワ
  • グローバル 設定 (~/.gitconfig) ウコイタㇰ ソモ キ

ID ウコイタㇰ 動作 (Identity Switching Behavior)

ID ウコイタㇰ、extension エキ (順番):

  1. Git Config (常に): git config --local user.name ウン user.email 設定
  2. SSH キー (sshKeyPath 設定): ssh-agent オロワ キー エレㇷ゚、エトゥㇾ キー オロワ
  3. GPG キー (gpgKeyId 設定): git config --local user.signingkey 設定 ウン サイン オロワ
  4. Submodule (オロワ): オㇿ submodule 設定 オロワ (デフォルト: 深さ 1)

Submodule 伝播 (Submodule Propagation Mechanism)

ローカル 設定 repository レベル オロワ、submodule オロワ ソモ キ。 タン extension submodule 伝播 機能 オロワ ("アドバンスド: Submodule" エヌカㇻ)。


アドバンスド: Submodule (Advanced: Submodule Support)

Git submodule アン repository、ID ウコイタㇰ ピㇼカノ ソモ キ。Submodule commit、Git タン submodule ローカル 設定 エキ; 設定 ソモ、グローバル 設定 オロワ (email ウェン!)。

Git ID Switcher submodule エヌカㇻ ウン ID オロワ。

{
  "gitIdSwitcher.applyToSubmodules": true,
  "gitIdSwitcher.submoduleDepth": 1
}
  • applyToSubmodules: タン 機能 オロワ/ソモ
  • submoduleDepth: ネーン 深さ?
    • 1: 直接 submodule ワノ (マウ)
    • 2+: ネスト submodule (submodule オロワ submodule)

タン ID 常に ピㇼカ、メイン repository ウン vendor ライブラリ commit。


トラブルシューティング (Troubleshooting)

SSH キー ウコイタㇰ ソモ キ?

  1. ssh-agent エキ エヌカㇻ:

    eval "$(ssh-agent -s)"
  2. キー パス エヌカㇻ:

    ls -la ~/.ssh/id_ed25519_*
  3. macOS、Keychain オロワ シネㇷ゚:

    ssh-add --apple-use-keychain ~/.ssh/id_ed25519_work

Push ID ウェン?

  1. リモート URL ホスト エイリアス エヌカㇻ:

    git remote -v
    # モノレ repository git@github-work:... オロワ
  2. オロワ:

    git remote set-url origin git@github-work:company/repo.git

GPG サイン ソモ キ?

  1. GPG キー ID エヌカㇻ:

    gpg --list-secret-keys --keyid-format SHORT
  2. サイン テスト:

    echo "test" | gpg --clearsign
  3. ID email ウン GPG キー email エネアン エヌカㇻ。

ID エヌカㇻ ソモ キ?

  • Git repository オロワ エヌカㇻ
  • settings.json シンタックス エラー エヌカㇻ
  • VS Code ウィンドウ リロード (Cmd+Shift+P → "Reload Window")

name フィールド エラー?

name フィールド タン 文字 アン、エラー:

` $ ( ) { } | & < >

サービス レー オロワ、service フィールド エキ。

// ウェン
"name": "シサㇺ (ウタㇻ)"

// ピㇼカ
"name": "シサㇺ",
"service": "GitHub"

新設定 エヌカㇻ ソモ キ?

Extension アップデート、新設定 設定画面 エヌカㇻ ソモ。

ホㇱキ: マシン リスタート。

VS Code 設定スキーマ メモリ キャッシュ、"Reload Window" ウン reinstall ソモ。

デフォルト値 (identities 等) カㇻ?

新インストール サンプル設定 エヌカㇻ ソモ、Settings Sync オロワ。

カㇻ 設定 マウ 保存、クラウド sync オロワ 新インストール デフォルト値 オロワ。

ホㇱキ:

  1. 設定画面 設定 エヌカㇻ
  2. 歯車アイコン → "設定リセット" エトゥㇾ
  3. Settings Sync sync (カㇻ 設定 クラウド エレㇷ゚)

コマンド

コマンド ウコイタㇰ
Git ID Switcher: Select Identity ID ピッカー
Git ID Switcher: Show Current Identity エネアン ID エヌカㇻ
Git ID Switcher: Show Documentation ドキュメント エヌカㇻ

Design Philosophy

「クアニ ネノ ネ?」— クコロ extension ネイタ ハウェアン。

Karesansui Architecture コㇿカ アラ: simple core (100 lines), deliberate quality (90% coverage, logging, timeouts) オッタ intentional constraints (GitHub API アㇰ、token management アㇰ)。

Karesansui Architecture

Full philosophy エヌカㇻ


Contributing

CONTRIBUTING.md エヌカㇻ。

License

MIT License - LICENSE エヌカㇻ。

Credits

Null;Variant オロワ


🐻 イヤイライケレ! 🐻