git icon indicating copy to clipboard operation
git copied to clipboard

add option ignoreFile to ignore file's contents like .gitignore

Open its-dibo opened this issue 3 years ago • 2 comments

as mentioned in docs the commit will include everything in assets even if it is included in .gitignore.

you can add an option to ignore a file's contents like that

["@semantic-release/git", {
  assets: ["**/*.*"],
  ignoreFile= '.gitignore'
}]

this approach is used by many tools tile eslint and prettier

also, it is a good idea to add an option to include changed files only

its-dibo avatar Apr 16 '22 14:04 its-dibo

Since this hasn't been closed or commented on, I have to imagine the maintainers would be okay with this. I'll make a PR for this sometime soon. :smile:

For posterity, this is related to #345 (a duplicate) and #55 (when this behavior was added).

To minimize maintenance burden, I'll make a boolean config flag named respectIgnoreFile. All setting it to true will do is drop the --force we send to the git add command.


EDIT: PR Created!

Kenneth-Sills avatar Nov 07 '24 18:11 Kenneth-Sills

very nice effort @Kenneth-Sills, you saved too many verbose configurations for many developers with this PR

its-dibo avatar Nov 18 '24 09:11 its-dibo