2012-06-20 31 views
1

這是推動我瘋了,我無法找到它爲什麼這樣做?git的結帳<branchname> systematicaly修改文件

git clone [email protected]:/my/working/repo.git 
--I don't do anything in the working copy-- 
git status 
--no modification/no file to be commited-- 
git checkout another_branch 
--I don't do anything in the working copy-- 
git status 
modified: /some/file/that/I/touched.php 
modified: /some/file/that/I/touched2.php 
modified: /some/file/that/I/touched3.php 

而且當我做了git的差異,僅顯示一些行結束脩改。 我看到你來...你會告訴我,我必須將autocrlf設置爲false ...已經嘗試過,並且沒有任何改變...

如果有人有關於如何解決這個問題的想法'd會比高興更多...

謝謝。

+0

一種可能性:區分大小寫的文件系統中的其他分支中的文件名有不同的資本。 –

+2

或者您的autocrlf設置不正確。 –

+0

是否有一個.gitattributes可以做一個塗抹過濾器? – vergenzt

回答

1

你應該嘗試:

git clone [email protected]:/my/working/repo.git 
git branch another_branch 
git checkout another_branch 
git pull origin another_branch 

我希望它應該爲你工作。

因爲如果我們直接使用git checkout another_branch它將切換到遠程分支不在本地創建分支。

第二種方式是:

git checkout -b another_branch