git update-index --skip-worktree是否影响上游回购? [英] Does git update-index --skip-worktree affect the upstream repo?

查看:132
本文介绍了git update-index --skip-worktree是否影响上游回购?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我本人已经与git合作了一段时间,现在正在为我们的团队设置一个仓库.我们开发了一个电子商务平台.

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.

虽然配置文件位于.gitignore上,但我想忽略--skip-worktree--assume-unchanged的上载目录.

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

我的问题-我找不到明确的答案-是--assume-unchanged--skip-worktree位是否将被推送到上游存储库?

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?

如果没有,那么确保git在存储库的所有实例中不操纵uploads目录的内容的最佳方法是什么?

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?

推荐答案

否,--assume-unchaged--skip-worktree都仅用于标记本地存储库中要在扫描更改时避免提交或跳过的文件

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.

如果要全局忽略所有存储库中的文件,最好的方法是将掩码放入.gitignore:

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

这篇关于git update-index --skip-worktree是否影响上游回购?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆