Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 994
jgangso Avatar asked Feb 17 '16 08:02

jgangso


1 Answers

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
like image 53
Zbynek Vyskovsky - kvr000 Avatar answered Oct 23 '22 03:10

Zbynek Vyskovsky - kvr000