Git常用命令

内容纲要
  1. git status时显示路径为8进制解决办法
    $ git status
    On branch main
    Your branch is up to date with 'origin/main'.
    Untracked files:
    (use "git add <file>..." to include in what will be committed)
        "\345\270\270\347\224\250\347\232\204\345\221\275\344\273\244.sh"

    将git配置文件 core.quotepath项设置为false。quotepath表示引用路径,加上–global表示全局配置
    使用命令

    git config --global core.quotepath false

    重新查看

    $ git status
    On branch main
    Your branch is up to date with 'origin/main'.
    Changes to be committed:
    (use "git restore --staged <file>..." to unstage)
        new file:   常用的命令.sh
  2. 解决git bash 终端显示中文乱码
    要注意的是,这样设置后,你的git bash终端也要设置成中文和utf-8编码。才能正确显示中文.
    在git bash的界面中右击空白处,弹出菜单,选择选项->文本->本地Locale,设置为zh_CN,而旁边的字符集选框选为UTF-8。
    英文显示则是:
    Options->Text->Locale改为zh_CN,Character set改为UTF-8

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注