如何忽略图标?在git中 [英] How to ignore Icon? in git

查看:109
本文介绍了如何忽略图标?在git中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试使用git设置Dropbox文件夹时,我看到一个不是由我创建的Icon \r文件。我试图在〜/ .gitignore文件中忽略它。但添加 Icon \r Icon \r \r 图标?根本不起作用。

While trying to setup a dropbox folder with git, I saw a "Icon\r" file which is not created by me. I try to ignore it in the ~/.gitignore file. But adding Icon\r Icon\r\r Icon? won't work at all.

推荐答案

图标?是OSX文件夹图标的文件。事实证明, \r 实际上是CRLF。所以我使用ruby将该行添加到 .gitignore 文件。打开终端并导航到 home 文件夹,然后:

The Icon? is the file of OSX folder icon. It turn out that \r is actually CRLF. So I use ruby to add the line to .gitignore file. Open terminal and navigate to home folder, then:

> irb
>> f = File.open(".gitignore", "a+") #<File:.gitignore>
>> f.write("Icon\r\r")  # output a integer
>> f.close
>> exit

这篇关于如何忽略图标?在git中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆