Pritish
Pritish

Reputation: 774

How .gcloudignore and .gitignore differ from each other?

When do we use .gcloudignore and .gitignore. How exactly do they differ?

Upvotes: 0

Views: 331

Answers (1)

Fariya Rahmat
Fariya Rahmat

Reputation: 3235

You can use a .gcloudignore file to specify files and directories that will not be uploaded to App Engine when you deploy your services. This is useful for ignoring build artifacts and other files that do not need to be uploaded with your deployment.

A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES below for details. Each line in a gitignore file specifies a pattern.

Each line in a gitignore file specifies a pattern. When deciding whether to ignore a path, Git normally checks gitignore patterns from multiple sources, with the following order of precedence, from highest to lowest

.gitignore files contain patterns that are matched against file names in your repository to determine whether or not they should be ignored.

You can "include" everything ignored by your .gitignore file in your .gcloudignore file by adding the following line:

#!include:.gitignore

Upvotes: 2

Related Questions