Unwanted files are committed to the repository
See original GitHub issueUnwanted files are committed to a repository after updating Lerna to version 3.22.0
(which contains the change added in https://github.com/lerna/lerna/pull/2445).
At least this change does not feel like a minor one, it definitely should be explicitly documented, not only in that PR description.
Expected Behavior
If temporary files are generated during build, they should not be committed back to the repository. At least this beahviour should not be default, but rather enabled with a switch.
Current Behavior
All untracked files are committed by default.
Possible Solution
Gitignore all the stuff would work, but it should not be.
Steps to Reproduce (for bugs)
- Introduce changes to a package.
- Generate some secrets and/or trash.
- Publish new version with Lerna
- All the secrets and trash are committed to the repository
Your Environment
Executable | Version |
---|---|
lerna --version |
3.22.0 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:26 (11 by maintainers)
Top Results From Across the Web
git - Remove file from latest commit - Stack Overflow
If you want to remove unwanted files from an old commit (even pushed) and don't want to create a new commit, which is...
Read more >How To Remove Files From Git Commit - devconnected
To remove files from commits, use the “git restore” command, specify the source using the “–source” option and the file to be removed...
Read more >How to Remove a File from Commit in Git - MakeUseOf
To remove a file that has been committed to a branch or Git repository, you can utilize the git reset command as follows:....
Read more >How to Remove Files from Git Commit - W3docs
The git rm command removes specific files or a collection of files from a git repository. The primary function of git rm is...
Read more >Useful Git Commands For Removing Accidentally Pushed or ...
It's worth noting that the first approach doesn't completely remove the offending file from the remote repository. Checking out a commit between ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released as v3.22.1. Thanks all for your patience.
@evocateur to extend on this, the suggestions to explicitly exclude files in .gitignore are impractical and outright unrealistic. They would require any and every file that could possibly be created or moved to the working directory knowingly or unknowingly by me or by any program that I run to be added to .gitignore, or else they WILL get published without prompt for review or confirmation. The lack of sensitivity to the severity of this issue is very surprising to me. People have their private credentials published without their knowledge as we speak.