Does git update-index --skip-worktree affect the upstream repo?

岁酱吖の 提交于 2019-12-07 10:18:38

问题


I've been working with git for a while myself, and am now setting up a repo for our team. We develop a eCommerce platform.

There are a few directories and files to be ignored, such as the upload directory and environment specific config files.

While the config files are on .gitignore, I'd like to ignore the uploads directory with either --skip-worktree or --assume-unchanged.

My question - which I couldn't find an explicit answer on - is if the --assume-unchanged or --skip-worktree bit will be pushed to the upstream repo?

If not, what would be the optimal way to ensure that git doesn't manipulate the contents of the uploads directory, across ALL instances of the repository?


回答1:


No, both --assume-unchaged and --skip-worktree is only used to mark the files in your local repository which you want to avoid committing or skip when scanning for changes.

If you want to ignore files globally in all repositories, the best way is to put the mask into .gitignore:

*.class         # will ignore all class files anywhere
/tmp/           # will ignore tmp directory but only in top directory
/config/prod/*  # will ignore all configuration files in /config/prod path


来源:https://stackoverflow.com/questions/35451148/does-git-update-index-skip-worktree-affect-the-upstream-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!