2009-07-30 2 views
4

필자와 동료들은 git을 Windows 재구성 클론의 특정 파일과 올바르게 작동시키는 데 심각한 문제가 있습니다. 복제본은 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")            

[email protected] ~/Documents/Workspace/prestige.git             
$ git diff "Web Applications/webclient/language/en/lang_copyitems.ini"          
diff --git a/Web Applications/webclient/language/en/lang_copyitems.ini b/Web Applications/webclient/language/ 
index 800c188..ed11c0e 100644                     
--- a/Web Applications/webclient/language/en/lang_copyitems.ini            
+++ b/Web Applications/webclient/language/en/lang_copyitems.ini            
@@ -1,12 +1,12 @@                        
-<EF><BB><BF> [Header]                      
-  Description=Language strings for 'copyitems.php'              
-                            
-  [Messages]                       
-  300=Copy                        
-  301=Close                        
-  302=COPY STORIES                      
-  303=Name                        
-  304=In Queue                       
-  305=New Name                       
-  306=Items to Copy                      
-  308=This item has mandatory metadata fields that are not correctly set. Click any part of this messag 
+<EF><BB><BF> [Header]                      
+  Description=Language strings for 'copyitems.php'              
+                            
+  [Messages]                       
+  300=Copy                        
+  301=Close                        
+  302=COPY STORIES                      
+  303=Name                        
+  304=In Queue                       
+  305=New Name                       
+  306=Items to Copy                      
+  308=This item has mandatory metadata fields that are not correctly set. Click any part of this messag 

[email protected] ~/Documents/Workspace/prestige.git             
$ git checkout HEAD "Web Applications/webclient/language/en/lang_copyitems.ini"        

[email protected] ~/Documents/Workspace/prestige.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         
# 

답변

6

문제를이 설정을 사용하면 GitHub guide에 의해 그림과 같이하면 자동 변환이 그 당신을 의미

... 체크 아웃 저장소의 동안 수행된다 fi를 열 필요가 없다. 르 모든 변화를 일으킬 수 있습니다.

autocrlf을 false로 유지하고 리턴 라인 문자를 존중할 수있는 편집기에서 해당 Windows 파일을 열 수 있습니까?

주 (illustrated here)이 변환을 필요로하는 경우, 일부 파일을 제외하고, 당신이 함께 상위 디렉토리에 .gitattributes를 추가 할 수 있습니다

myFile -crlf 

당신이 경로에 속성을 설정 파일에서 (또는 패턴)을 설정하거나 (빼기 기호와 함께) 설정을 해제하십시오.
crlf 속성은 파일이 core.autocrlf 옵션의 영향을 받는지 여부를 나타내는 속성입니다. 설정을 해제하면, Git은 파일의 줄 끝 부분을 엉망으로 만들지 않습니다.

+0

위대한 링크 Github에서 게시했습니다. 그래서 해결책은 한 번 이상 그 파일을 커밋하는 것입니다. 포인터를 가져 주셔서 감사합니다. – jkp

1

git 1.7.3.1을 사용하는 Windows 7 컴퓨터에서이 문제를 해결하려면 core.filemode 옵션을 false로 설정해야합니다.

git config -e --local 
+0

감사합니다. 여러 해 동안 줄 끝 깃발로 어지럽히고 난 후에. .git/config에서 core.filemode를 변경하면 문제가 없습니다. – griffin2000