首页 > 解决方案 > 在 Window 10 上遇到 git bash 问题,最近的更改使我无法更新它

问题描述

我安装了 Git 版本 2.31.1.windows.1 并重新安装它。我对其进行了更改以添加新别名。我做了一个尝试获取文件以重新加载它并收到此错误。

bash:/c/Users/DawsonSchaffer/.bashrc:地址错误

所以我恢复了以前的版本,它工作正常。但是我现在仍然遇到同样的错误。我知道这不是很多这是我的 .bashrc 文件

# History settings
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=10000
HISTTIMEFORMAT="%F %T "

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
    else
        color_prompt=
    fi
fi

# load color variables
if [ -f ~/.bash_colors ]; then
    . ~/.bash_colors
fi

# prompt
if [ "$color_prompt" = yes ]; then
    PS1="${GREEN}ganymede@${BLUE}dawson:${ICYAN}\W${RESET}${IYELLOW} \$(parse_git_branch) $ " 
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

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

# function parse_git_branch() {
#   BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
#   if [ ! "${BRANCH}" == "" ]
#   then
#       STAT=`parse_git_dirty`
#       echo "[${BRANCH}${STAT}]"
#   else
#       echo ""
#   fi
# }

# file colors
LS_ORIGINAL=LS_COLORS
LS_COLORS='di=93:*.py=92:*.qml=92sb'
export LS_COLORS

# Alias definitions.
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# Alias functions.
if [ -f ~/.bash_functions ]; then
    . ~/.bash_functions
fi

# virtual environment home
export WORKON_HOME='C:\Users\DawsonSchaffer\Documents\ProjectsDirectory\virtualenvirinments'

任何帮助将不胜感激。

谢谢道森

标签: windows-10git-bash

解决方案


抱歉,在多次扫描文件后,我终于发现我的 .bashrc 中有一个时髦的字符,一旦我删除它,每个都可以正常工作。

谢谢道森


推荐阅读