Exclude package-lock.json from GitHub contribution activity

Viewed 6938

Now that npm v5.0.0 is out, using npm packages auto-generates a package-lock.json on npm install. In my case, my package-lock.json file happens to be close to 10,000 lines of code.

package-lock.json

Npm also suggests this file should be committed:

npm notice created a lockfile as package-lock.json. You should commit this file.

I don't want this file to be included in the line counts for the contribution activity on GitHub.

I've tried setting the files as vendored code in .gitattributes, but that only affects the repository language.

Is there a way to exclude a file from the contribution activity without adding it to .gitignore?

2 Answers

Run

git config --global user.email "you@example.com"

git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository.

Related