【发布时间】:2013-09-03 11:58:44
【问题描述】:
我做了一些搜索,发现这个别名是为了让功能分支与开发分支保持同步,当我手动从 Git bash 运行时,开发分支可以工作。
sync='!f() { echo Syncing this branch with develop && git checkout develop &&
git pull && git checkout – && git rebase develop; }; f'
我尝试将此别名放在 .gitconfig 中,但出现以下错误
error: pathspec '"\342\200\223"' did not match any file(s) known to git.
我发现的是 git checkout -,它代表,回到你所在的最后一个分支会产生这个错误。
我也尝试将相同的命令放在 .bashrc 中,如下所示
alias sync='echo Syncing this branch with develop && git checkout develop && git pull
&& git checkout – && git rebase develop'
这会产生同样的错误。
但是,只是为了确保当我手动运行 Git Bash 中的所有命令时,它们都可以正常工作,所以没有其他问题。似乎这只是因为 Windows 上的 msysgit 或 bash 存在差异,因为我已经阅读了 mac 和 Linux 上 git 的这些别名工作。
有开明的人能告诉我如何更改它以使其在 Windows 上运行吗?
谢谢
【问题讨论】:
标签: windows git bash msysgit git-config