Date
May. 19th, 2024
 
2024年 4月 12日

Post: Git: .DS_Store

Git: .DS_Store

Published 12:12 Dec 12, 2014.

Created by @ezra. Categorized in #Version Control, and tagged as #Git.

Source format: Markdown

Table of Content

.DS_Store 是个很烦人的家伙, 在使用版本控制工具时, 我们都希望能忽略它的存在, 不过在每一个仓库中都设置一次好像更烦人, 那现在我们想办法一次性解决这个问题吧:

vi ~/.gitignore_global

i 进入编辑模式, 增加新行:

.DS_Store
.DS_Store?

如果你要忽略其它没用的文件, 可以继续添加新的行。

esc 后输入 :wq 保存并推出, 然后进入你的仓库:

vi .git/config

[core] 中增加:

excludesfile = /Users/用户名/.gitignore_global

保存退出, 然后提交这次改动。

现在, 你可以 touch 一个 .DS_Store 文件再用 git status 来试试效果了。

Pinned Message
HOTODOGO
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF