我的全局 git 配置中有以下 Git 别名。
pushnew = !f() { export tmp_branch=`git branch | grep '* ' | tr -d '* '` && git push --set-upstream origin $tmp_branch; unset $tmp_branch; }; f
运行它时,我得到以下输出:
* [new branch] bug/graphs -> bug/graphs
Branch bug/graphs set up to track remote branch bug/graphs from origin.
f() { export tmp_branch=`git branch | grep '* ' | tr -d '* '` && git push --set-upstream origin $tmp_branch; unset $tmp_branch; }; f: 1: unset: bug/graphs: bad variable name
我已经看到了这个问题,但如果这是解决方案,那么如何在 Git 别名的上下文中应用修复?