2013-02-26 84 views
3

我們正在與一些擁有Mac的人一起開展一個項目。.gitattributes文件應該在提交中嗎?

我自己在windows上運行。 我們遇到了換行問題。

我上,我可以添加此github上寫着:

# Set default behaviour, in case users don't have core.autocrlf set. 
* text=auto 

# Explicitly declare text files we want to always be normalized and converted 
# to native line endings on checkout. 
*.c text 
*.h text 

# Declare files that will always have CRLF line endings on checkout. 
*.sln text eol=crlf 

# Denote all files that are truly binary and should not be modified. 
*.png binary 
*.jpg binary 

到.gitattributes

但我應該提交這個文件到GitHub上讓其他人使用Mac得到相同的設置?

請大家幫幫我:○

如果不管我們正在編碼的網站的。 (PHP,JS文件和東西)。

備案,我是唯一一個Windows ..所以是的,我能做什麼?

回答

1

我加了這一點:

# Set default behaviour, in case users don't have core.autocrlf set. 
* text=auto 

# Explicitly declare text files we want to always be normalized and converted 
# to native line endings on checkout. 
*.c text 
*.h text 

# Declare files that will always have CRLF line endings on checkout. 
*.sln text eol=crlf 

# Denote all files that are truly binary and should not be modified. 
*.png binary 
*.jpg binary 

,並致力於爲GitHub的服務器。所以每個有這個問題的人都會解決問題。

4

首先,我建議先閱讀documentation

它建議您檢查.gitattributes文件在您的存儲庫的根目錄或在您的本地.git文件夾中:.git/info/attributes

後一個選項可能影響最小(如果您是唯一的Windows用戶)。

有了這樣的事情,我傾向於把責任放在任何'喜歡與衆不同'的團隊中 - 例如,如果所有的開發者都使用Mac,而另一個開發者使用Windows,那麼確實是是由那些反對穀物的人來解決的。這沒有什麼惡意,只是公平:-)

+0

是的,我知道。但我已閱讀文檔,但無法弄清楚該文件是否應該是git服務器或不是。 – Muqito 2013-02-26 13:58:12

+0

你是指_literally_在git服務器上或「簽入」? – 2013-02-26 14:00:01

+0

我對Git不太瞭解,因爲我剛剛發現它。但是當我嘗試做出提交時,它會要求我將文件上傳到服務器,然後我確實解決了這個問題:O 那麼我該怎麼做? xD我是否回答自己的問題或什麼? – Muqito 2013-02-26 22:36:52

相關問題