跳过脚本中的提交路径

时间:2017-06-24 00:14:41

标签: git github path gitignore

我正在寻找允许我避免在脚本中提交路径的git代码。我经常在Mac和PC之间切换以处理本地保存的数据,因为它们使用不同的目录,如果我切换系统,我需要更改路径,这很烦人。我试着用

git rm -r --cached <dir>

但路径仍然存在。或者我应该在这种情况下使用gitignore吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

在这种情况下,我使用.gitignore的模板作为mac:

# General
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

你可以在这里找到很多有用的模板:

https://github.com/github/gitignore/blob/master/Global/macOS.gitignore

相关问题