【发布时间】:2018-03-06 17:54:00
【问题描述】:
我在 Jenkins 中为我的 Git 存储库(Git on TFS online)进行了维护工作,以删除与特定不匹配的分支条件或陈旧的分支。运行作业时会这样说:
Going to remove branch development/Batch_R7
fatal: InvalidOperationException encountered.
Showing a modal dialog box or form when the application is not running in
UserInteractive mode is not a valid operation. Specify the ServiceNotification
or DefaultDesktopOnly style to display a notification from a service
application.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://everisidbtfs.visualstudio.com': No
error
我从 Powershell 脚本运行此命令。
其他 Git 命令在该 Powershell 脚本中运行良好,例如获取分支列表。
如果我从 Jenkins 服务器(或任何其他机器)中的 Powershell 命令行运行 PowerShell 脚本,它可以正常工作。
TFS 用户有权删除遥控器,并向 Jenkins 作业提供凭据。
这是我用来删除分支的 Git 命令:
git push --porcelain --progress --recurse-submodules=check origin :refs/heads/<branch_name>
有什么解决方法吗?我做错了什么?
我想到,由于 git 命令是“写入”操作(推送),可能 Jenkins 中存在一些安全限制...我在自动化脚本中使用的其余 git 命令是“只读”。
【问题讨论】:
标签: git powershell jenkins tfs