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.

[git] Adding a folder to `.gitignore` should not add every single file

See original GitHub issue
  • VS Code Version: v1.57.1
  • OS Version: Win 20H1

Steps to Reproduce:

  1. Create an empty repository
  2. Do npm init && npm install whatever
  3. Switch to the SVM view
  4. Oops, you have one bajillion changed files in your working copy! Right-click the node_modules folder in the SCM view and choose “Add to .gitignore”.

Expected behavior:

  • node_modules/ is added to the .gitignore.

Actual behavior:

  • Every single file in the node_modules subtree of the repository is added separately to the .gitignore

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
danila-grobovcommented, Nov 30, 2021

@LinqLover @lszomoru Hey, I think I fixed the issue! Could you take a look at my pull request?

2reactions
LinqLovercommented, Nov 2, 2021

@danila-grobov I would start here and here. I am not into the VS Code impl at all, but as there is no enumeration of files, I fear that the UI could always pass all single children of the selected item to the command … Great that you are looking into this! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

.gitignore File – How to Ignore Files and Folders in Git
Inside . gitignore , you can tell Git to ignore only a single file or a single folder by mentioning the name or...
Read more >
Make .gitignore ignore everything except a few files
To fix, add (!*/), which matches any subdirectories (recursively) in current directory. This won't help the parent answer, which is whitelisting specific files...
Read more >
How to Use a .gitignore File - Pluralsight
It lets Git know that it should ignore certain files and not track them. ... However, you can put it in any folder...
Read more >
.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git sees every file in your working copy as one of three things: ... Ignored files are usually build artifacts and machine generated...
Read more >
Ignoring Files and Directories in Git (.gitignore) - Linuxize
Git also allows you to create a global .gitignore file, where you can define ignore rules for every Git repository on your local...
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