我正在寻找允许我避免在脚本中提交路径的git代码。我经常在Mac和PC之间切换以处理本地保存的数据,因为它们使用不同的目录,如果我切换系统,我需要更改路径,这很烦人。我试着用
git rm -r --cached <dir>
但路径仍然存在。或者我应该在这种情况下使用gitignore
吗?
谢谢!
答案 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