MaKR
MaKR

Reputation: 1892

How to bypass .gitignore?

We are trying to set up a new staging server and are attempting a git clone. We would like to one-time pull files from our .gitignore (data files which should exist but don't need to be current). Is there a way to ignore .gitignore just this once?

Upvotes: 0

Views: 834

Answers (1)

kucinghitam
kucinghitam

Reputation: 474

You can just have the files on default state on remote repository, remove the files from .gitignore, and ignore changes that will be made on already-tracked files locally using:

git update-index --skip-worktree [filepath]

Every collaborators of your project should ideally do this so they can modify the files locally without affecting the ones on remote repository.

Upvotes: 1

Related Questions