【发布时间】:2025-12-17 05:10:02
【问题描述】:
git push -u origin <branch>
当您为 bitbucket 运行此命令时,它会为您提供类似的输出,
Counting objects:
remote:
remote: Create pull request for <branch>
remote: https://bitbucket.com/...
但是当我尝试将该输出存储在变量中并打印该变量时,它会给我这样的输出,
a=$(git push -q -u origin <branch>)
echo $a
Branch <branch> set up to track remote branch <branch> from origin.
我想存储上面的输出,或者我只想将拉取请求 URL 存储到一个变量中。
拉取请求 URL 是首选选项。 谢谢
【问题讨论】:
-
小提示:它是 bitbucket.org。 Bitbucket.com 只是重定向。