question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unwanted files are committed to the repository

See original GitHub issue

Unwanted 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)

  1. Introduce changes to a package.
  2. Generate some secrets and/or trash.
  3. Publish new version with Lerna
  4. All the secrets and trash are committed to the repository

Your Environment

Executable Version
lerna --version 3.22.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:26 (11 by maintainers)

github_iconTop GitHub Comments

6reactions
evocateurcommented, Jun 9, 2020

Released as v3.22.1. Thanks all for your patience.

4reactions
fubarcommented, May 30, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found