2010-02-24 4 views
5

리눅스에서 git (git-svn과 함께 사용)하고 동료는 windows에서 svn을 사용합니다.git svn windows linux 공백 문제

git은 여러 번 공백 문제를보고합니다. 실제로 이러한 문제로 인해 선형 기록을 작성하지 못하고 병합 충돌이 발생합니다.

공백 문제가 발생하도록 Windows 및 Linux에서 svn/git 및 git-svn을 구성하는 가장 간단한 방법은 무엇입니까?

보고 된 병합 충돌이 마스터에서 선형 역사에서, 다음과 같은 :

error: patch failed: frontend/templates/frontend/base.html:38 
error: frontend/templates/frontend/base.html: patch does not apply 
error: patch failed: frontend/templates/frontend/footer.html:1 
error: frontend/templates/frontend/footer.html: patch does not apply 
error: patch failed: frontend/templates/frontend/index.html:1 
error: frontend/templates/frontend/index.html: patch does not apply 
Using index info to reconstruct a base tree... 
<stdin>:15: trailing whitespace. 

<stdin>:20: trailing whitespace. 
      <a href="{% url frontend_index %}"> 
<stdin>:22: trailing whitespace. 
      </a> 
<stdin>:24: trailing whitespace. 
     <span class="companyname"> 
<stdin>:25: trailing whitespace. 
      <a href="{% url frontend_index %}"> 
warning: squelched 74 whitespace errors 
warning: 79 lines add whitespace errors. 
Falling back to patching base and 3-way merge... 
Auto-merging frontend/templates/frontend/base.html 
CONFLICT (content): Merge conflict in frontend/templates/frontend/base.html 
Auto-merging frontend/templates/frontend/index.html 
CONFLICT (content): Merge conflict in frontend/templates/frontend/index.html 
Failed to merge in the changes. 
Patch failed at 0001 template changes 

When you have resolved this problem run "git rebase --continue". 
If you would prefer to skip this patch, instead run "git rebase --skip". 
To restore the original branch and stop rebasing run "git rebase --abort". 

어떻게 공백 문제를 해결합니까?

답변

11

고정 공백 오류

이제 작동합니다 .gitconfig

[core] 
    whitespace=nowarn 

자식 REBASE이 추가. (모든 커밋에 선택적으로 좋은 생각이 프로젝트의 규칙과 팀에 따라 달라집니다 여부. 자식이 모든 공백을 해결해야하는 것과 fix,-indent-with-non-tab,trailing-space의 일부를 추가 할 수 있습니다.)

고정 EOL 오류

[core] 
    autocrlf = true 
.gitconfig에서

이렇게하면 모든 텍스트 파일에 창 줄 끝이 생깁니다. svn은 기본적으로 줄 끝을 무시하고 Windows의 텍스트 편집기가 정상적으로 작동하면 그대로 둘 수 있습니다. 그렇지 않으면 this file을 svn config에 추가하십시오 (선택적으로 native에서 CRLF으로 변경). 일관된 CRLF 라인 결말을 보장합니다.

autocrlf = input을 설정하고 전체적으로 일관된 Linux 행 결말을 위해 native에서 LF으로 변경하십시오.