Gitas – 一款 Git 账户切换工具
Gitas – A tool for Git account switching

原始链接: https://github.com/letmutex/gitas

## gitas:轻松管理多个 Git 账户 **gitas** 是一款在 Linux、macOS 和 Windows 上无缝切换多个 Git 账户的工具。它简化了使用个人和工作账户,或访问私有仓库的操作。 **安装** 通过 shell 脚本、PowerShell、Homebrew 或 Cargo 可以轻松完成。 **主要特性:** * **账户管理:** 使用交互式 TUI (`gitas`) 添加、编辑和删除账户。 * **身份切换:** 更新 Git 配置以持久使用账户。 * **命令代理:** 以特定账户运行单个 Git 命令,而无需更改您的配置 (`gitas git clone ...`)。 * **安全存储:** 凭据安全地存储在您系统的原生钥匙链中。 **卸载** 也同样简单,使用与安装相对应的方法即可。 gitas 采用 Apache 许可证 2.0。安装脚本和更多信息可在项目的 GitHub 页面上找到。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Gitas – 一个 Git 账户切换工具 (github.com/letmutex) 5 分,by letmutex 1 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 帮助 rgoulter 20 分钟前 [–] 对于“为不同目录使用不同账户/配置”的用例,git 的配置有 includeIf。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Git Account Switch / Git As

Screenshot

# Install Script (Linux & macOS)
curl -fsSL https://raw.githubusercontent.com/letmutex/gitas/main/install.sh | sh

# Install Script (Windows PowerShell)
irm https://raw.githubusercontent.com/letmutex/gitas/main/install.ps1 | iex

# Homebrew
brew tap letmutex/tap
brew install gitas

# Cargo
cargo install gitas
# Open interactive TUI to switch, edit, or remove accounts
gitas

# Add a new account (Manual or GitHub Login)
gitas add

# Run any git command as a specific account
# Useful for cloning private projects
gitas git clone <url>

Switching Identity: Updates your local/global git config and pre-fills the credential cache, so subsequent git commands work seamlessly without prompts.

Command Proxy (gitas git): Executes git with a temporary identity and credential helper using -c flags. It does not modify any config files, making it perfect for one-off commands.

Secure Storage: All tokens are stored in your system's native keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service).

# Linux / macOS (Install Script)
rm -rf ~/.gitas

# Windows (PowerShell Install Script)
Remove-Item -Path "$env:LOCALAPPDATA\gitas" -Recurse -Force

# Homebrew
brew uninstall gitas

# Cargo
cargo uninstall gitas

This project is licensed under the Apache License, Version 2.0.

联系我们 contact @ memedata.com