Exclude package-lock.json from GitHub contribution activity

后端 未结 2 1720
一整个雨季
一整个雨季 2021-02-05 07:41

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 ha

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 08:31

    One way to exclude a file from modifying a user's contribution activity is by associating the commit with a placeholder author. This can be done by providing an empty email field <> in the --author option.

    The signature of the --author option: --author="NAME "

    git add package-lock.json
    git commit -m 'initial commit' --author='nocontribute <>'
    

    FOO_AUTHOR committed with REAL_AUTHOR x time ago.

提交回复
热议问题