我安装的 Git 出现了奇怪的行为。常用的 Git 命令可以正常工作:init
、add
、commit
、push
、pull
,但是当我输入任何与 相关的命令时branch
,它会报告:
C:\Program Files\Deltares\Delft3D 4.03.01\win64\util\bin\more.exe: C:Program: command not found
$ git branch
C:\Program Files\Deltares\Delft3D 4.03.01\win64\util\bin\more.exe: C:Program: command not found
关于我的设置的一些信息:
默认安装
根据错误信息,它与我的 Delft3D 和 more.exe 有关,但我尝试在系统变量中查找任何角落并删除任何包含 Delft3D 的项目。但仍然不起作用。
一些有用的信息:
$ set |grep -F GIT
GIT_EXEC_PATH='C:/Program Files/Git/mingw64/libexec/git-core'
PWD=/d/Workspace/GITtest
if [ -n "${GIT_DIR-}" ]; then
test -d "${GIT_DIR-}" && __git_repo_path="$GIT_DIR";
if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST"; then
__gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST";
if [ "true" = "$inside_worktree" ] && [ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] && [ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] && git check-ignore -q .; then
case "${GIT_PS1_DESCRIBE_STYLE-}" in
b="GIT_DIR!";
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] && [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] && git rev-parse --verify --quiet refs/stash > /dev/null; then
if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] && [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] && git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' > /dev/null 2> /dev/null; then
if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
local z="${GIT_PS1_STATESEPARATOR-" "}";
if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
GIT_PS1_SHOWUPSTREAM="$value";
if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
for option in ${GIT_PS1_SHOWUPSTREAM};
upstream=${GIT_SVN_ID:-git-svn};
if [ "$GIT_COMPLETION_CHECKOUT_NO_GUESS" = "1" ] || [ -n "$(__git_find_on_cmdline "$flags")" ]; then
if test -n "$GIT_TESTING_ALL_COMMAND_LIST"; then
__gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(__git --list-cmds=alias,list-guide) gitk";
$ cat ~/.gitconfig
[user]
name = QB-LAPTOP
email = [email protected]
[gui]
recentrepo = D:/New
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
$ command -V git
git is hashed (/mingw64/bin/git)
$ git --version
git version 2.22.0.windows.1