首页 > 解决方案 > 'git add -u' 暂存所有 repo 文件

问题描述

出于团队处理目的,我在 Linux 上有一个本地 GIT 存储库(centOS 7.5.1804,git 版本 1.8.3.1)。在我这边,我从 Windows、Sublime Merge 或直接从 gitbash(windows 10,git 版本 2.31.1.windows.1)管理它。我在 Sublime Merge 上直接打开 linux Repo(通过 windows 上的网络地图),或者转到 gitbash 上的 linux 目录。如果我修改了几个文件(例如 3 个),当我在 Sublime Merge 上使用“Stage All”或在 gitbash 上使用“git add -u”时,我所有的 repo 文件都已暂存(在我的情况下为 300)。Sublime Merge 为每个文件显示一个附加警告。.git 属性的示例:

警告: .gitattributes 中的 LF 将被 CRLF 替换。该文件将在您的工作目录中具有其原始行结尾

我已经验证了文件,所有文件(修改或未修改)或使用 Linux endline (LR):在 Windows 上使用 VSCode、sublime text 和 notepad++ 检查。

在 gitbash 上,“git status”将我所有的 300 个 repo 文件列为已修改且未暂存。我对同一个 Repo 上的 linux 术语没有任何问题。

我的 git 在 Windows 上出了什么问题,以及如何能够在我的 linux Repo 上使用 windows 现代 GIT GUI 软件?

谢谢。

信息:在 Windows 上“git config --list --show-origin --show-scope”

system  file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
system  file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl
system  file:C:/Program Files/Git/etc/gitconfig diff.astextplain.textconv=astextplain
system  file:C:/Program Files/Git/etc/gitconfig credential.helper=manager-core
system  file:C:/Program Files/Git/etc/gitconfig core.fscache=true
system  file:C:/Program Files/Git/etc/gitconfig core.symlinks=false
system  file:C:/Program Files/Git/etc/gitconfig pull.rebase=false
system  file:C:/Program Files/Git/etc/gitconfig credential.https://dev.azure.com.usehttppath=true
system  file:C:/Program Files/Git/etc/gitconfig init.defaultbranch=master
global  file:C:/Users/john/.gitconfig           user.email=john.doe@discret.com
global  file:C:/Users/john/.gitconfig           user.name=john
global  file:C:/Users/john/.gitconfig           diff.tool=p4merge
global  file:C:/Users/john/.gitconfig           difftool.p4merge.path=C:\Users\john\Perforce\p4merge.exe
global  file:C:/Users/john/.gitconfig           merge.tool=p4merge
global  file:C:/Users/john/.gitconfig           mergetool.p4merge.path=C:\Users\john\Perforce\p4merge.exe
global  file:C:/Users/john/.gitconfig           mergetool.keepbackup=false
global  file:C:/Users/john/.gitconfig           core.autocrlf=false
local   file:.git/config                        core.repositoryformatversion=0
local   file:.git/config                        core.filemode=true
local   file:.git/config                        core.bare=false
local   file:.git/config                        core.logallrefupdates=true
local   file:.git/config                        core.autocrlf=false
local   file:.git/config                        remote.origin.url=https://server.com/git/project.git
local   file:.git/config                        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
local   file:.git/config                        branch.john_branch.remote=origin
local   file:.git/config                        branch.john_branch.merge=refs/heads/john_branch

标签: gitsublimemerge

解决方案


推荐阅读