58492

.gitignore Doesn't Seem To Work

Question:

My .gitignore:

.DS_Store /.idea /.idea_modules /out /project /target /*.iml */resolution-cache/* */streams/* */target/*

But nonetheless, the folders .idea, .idea_modules and target have appeared in a repo and are still there.

Your ideas?

Answer1:

Ignoring is only useful for files that are not currently being tracked by the repo. If those directories were added to the repo before being put in .gitignore, they will continue to be tracked.

Use git rm --cached <file> to stop tracking a file.

Of course you should make a commit with the removed files and push to the repo to see the changes in the remote repository

Recommend

  • How can I commit changes that I've made in node_modules back to git?
  • Push refs/remotes to new origin, how?
  • com.sap.cloud.sdk.frameworks.hystrix.ScpNeoHystrixBootstrapListenerjava.lang.IllegalStateException
  • How to export SSL certificate from azure to local server?
  • Ignoring a field without modifying the POJO class with Jackson
  • Shift operation implementation in java
  • .NET Obfuscation [SmartAssembly]
  • Append dynamic vue component after specific element
  • Wierd Results using script to find length of a string?
  • Concise R data.table syntax for modal value (most frequent) by group
  • Setting UIToolbar background image with iOS5.1
  • Referencing external dependencies in GGTS by convention
  • force insert with spring data jpa
  • Batch file to delete all folders in a directory except the newest folder
  • Google cloud datastore emulator init data
  • “git push” doing the same as “git fetch” from the remote
  • What is the first step to using a REST API in Rails?
  • Xamarin iOS debugger not hitting breakpoints
  • Git cleanup/garbage collection on remote VSO git repository
  • Visual Studio - PathTooLongException even when the path length is less than 260 characters
  • Iterate twice through a DataReader
  • A class implementing two different IObservables?
  • HttpClient: disabling chunked encoding
  • Clear fused location provider's location for testing
  • android.support.v7.widget.Toolbar VectorDrawableCompat IllegalStateException when using support lib
  • What and where is mdimport
  • Does it make sense to call System.gc() and Thread.sleep() when working on Bitmaps?
  • Read text file and split every line in MSBuild
  • C# - Serializing and deserializing static member
  • Get object from AWS S3 as a stream
  • Java applet as stand-alone Windows application?
  • How do you troubleshoot character encoding problems?
  • WOWZA + RTMP + HTML5 Playback?
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • How do I rollback to a specific git commit
  • Is there a mandatory requirement to switch app.yaml?
  • Error creating VM instance in Google Compute Engine
  • How to get Windows thread pool to call class member function?
  • Busy indicator not showing up in wpf window [duplicate]