Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 跳过脚本中的提交路径_Git_Github_Path_Gitignore - Fatal编程技术网

Git 跳过脚本中的提交路径

Git 跳过脚本中的提交路径,git,github,path,gitignore,Git,Github,Path,Gitignore,我正在寻找一个git代码,它允许我避免在脚本中提交路径。我经常在Mac和PC之间切换以处理本地保存的数据,因为它们使用不同的目录,如果切换系统,我需要更改路径,这很烦人。我试着用 git rm -r --cached <dir> git rm-r——缓存 但这些路径仍在提交中。或者在这种情况下我应该使用gitignore 谢谢 在本例中,我使用.gitignore for mac的模板: # General *.DS_Store .AppleDouble .LSOverride

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

git rm -r --cached <dir>
git rm-r——缓存
但这些路径仍在提交中。或者在这种情况下我应该使用
gitignore


谢谢

在本例中,我使用.gitignore for 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
您可以在此处找到许多有用的模板:


您是指脚本文件中的路径吗?@VonC是的,没错。