在bash_profile文件中,我试图传递git_branch并希望在命令窗口中获得相同的结果

问题描述

parse_git_branch(){
     git branch 2 > /dev/null | sed -e'/^[^*]/d' -e 's/*\(.*\)/(\1)/'
}

.bash_profile文件中的上述方法在我的命令窗口中获取分支名称,在终端窗口中获​​取以下错误

fatal: A branch named '2' already exists.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)