2017-06-24 22 views
2

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

git rm -r --cached <dir> 

但路径仍在提交。或者我应该在这种情况下使用gitignore

谢谢!

+0

你的意思是一个脚本文件中的路径? – VonC

+0

@VonC是的,那是对的。 – Kay

回答

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