dsh plugins中文
← Back to popular plugin directory

git commit fixes the authorship of the environment itself

LoserFox/dsh-git-identity · tools

DSH plug-in: git submits a fixed use environment with its own authorship (gh CLI login account is preferred, GitHub noreply email), GITAUTHOR/GITCOMMITTER environment variable injection overrides all git config.

★ 7GitHub stars
0Forks
2026-08-13Last updated
JavaScriptLanguage
License

Project overview

DSH profile bundle(0812+ 的官方插件系统):让 DSH 内产生的所有 git 提交使用 环境自身的作者身份。优先读取 gh CLI 的登录账号(name 取 login,email 取 GitHub noreply 地址 + @users.noreply.github.com),其次启动环境的 GITAUTHOR、git config --global 兜底。 为什么需要它

DSH 的 agent 会话通过 bash 工具执行 git commit。历史上一旦某个会话显式 -c user.name="DSH Agent" 或改掉了 git 配置,后续提交就会带着错误的作者。 本插件在加载时把解析到的身份写入 GITAUTHOR / GITCOMMITTER 四个环境变量, DSH 的 subprocess 层会把 process.env(剔除凭据)传给每个 bash 子进程,而 git 的 环境变量优先级高于一切 git config——所以 DSH 内任何路径发起的提交都必然使用该身份。

1. 插件配置 { name, email }(显式钉死,最稳;未登录 gh 时可在此配置) 2. gh CLI 登录账号(gh api user) 3. 启动环境的 GITAUTHORNAME / GITAUTHOREMAIL 4. git config --global user.name / user.email 兜底

Install command

dsh plugin --profile web add github:LoserFox/dsh-git-identity
View GitHub repository ↗Back to popular plugin directory