相关疑难解决方法(0)

即使内容相同,Git状态也会将文件显示为已更改

我从其他人那里收到了git checkout,并尝试将未分级的更改提交到本地存储库.但是,即使内容完全相同,很多(如果不是每个)文件也会显示为已修改.

我已经设置core.fileMode为false并且设置core.autocrlf为false,但没有成功.

值得一提的是,我收到的Git repo来自使用Windows的人,而我使用的是Linux.

如何进行实际更改?

编辑:输出git config -l:

user.name=Aron Rotteveel
user.email=<removed>
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=auto
color.ui=true
color.pager=true
color.branch.current=yellow reverse
color.branch.local=yellow
color.branch.remote=green
color.diff.meta=yellow bold
color.diff.frag=magenta bold
color.diff.old=red bold
color.diff.new=green bold
color.status.added=yellow
color.status.changed=green
color.status.untracked=cyan
core.pager=less -FRSX
core.whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
alias.co=checkout
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
core.autocrlf=false
remote.origin.url=<removed>
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)

更新:添加了一些随机示例文件.这些文件只是纯文本,因此最容易包含.

原始文件位于:https://gist.github.com/c3c5302430935155ef3d.Hexdumps肯定表明文件不同,但我不知道是什么导致这个,以及如何解决它.

HEAD版本:

0000000: 4854 4d4c 2e53 6166 654f 626a 6563 740d  HTML.SafeObject.
0000010: 0a54 5950 453a …
Run Code Online (Sandbox Code Playgroud)

git

168
推荐指数
11
解决办法
13万
查看次数

如何在GIT中向文件添加chmod权限?

我想git提交一个.sh文件,但是当我在另一台服务器上检出同一个文件时,希望它是可执行的.

有没有办法这样做没有手动chmod u + x文件在签出文件的服务器?

git

139
推荐指数
4
解决办法
8万
查看次数

git中裸共享存储库的概念

我一直面临着理解裸存储库的困难.我到处都读到共享的回购是一个简单的回购.为什么它必须是一个简单的回购?它不能是合作者克隆然后推/拉的正常回购吗?

git repository git-bare

7
推荐指数
1
解决办法
2176
查看次数

处理Git拒绝重置的文件?

我和我的同事git在使用我们的Windows repostiory克隆上的某些文件时遇到了很大的麻烦.克隆是通过克隆源自OSX机器的存储库而制作的.我们已经将autocrlf设置为true,但问题是我们会定期查找git认为已更改的文件,即使我们从未触摸它们(我们甚至不在编辑器中打开它们).

以下输出说明了问题:我出错的任何想法?

$ git status                                                                                                 
# On branch master                                                                                           
# Your branch is behind 'origin/master' by 27 commits, and can be fast-forwarded.                            
#                                                                                                            
# Changed but not updated:                                                                                   
#   (use "git add <file>..." to update what will be committed)                                               
#   (use "git checkout -- <file>..." to discard changes in working directory)                                
#                                                                                                            
#       modified:   Web Applications/webclient/language/en/lang_copyitems.ini                                
#                                                                                                            
no changes added to commit (use "git add" and/or "git commit -a")                                            

Administrator@windows-dev ~/Documents/Workspace/prestige.git                                                 
$ git diff "Web …
Run Code Online (Sandbox Code Playgroud)

windows git line-endings

5
推荐指数
1
解决办法
5884
查看次数

标签 统计

git ×4

git-bare ×1

line-endings ×1

repository ×1

windows ×1