Tag: gitignore

Track file in master repository which is ignored in submodule

I have a structure like this: /.gitignore /submodule/.gitignore /submodule/file.txt Inside my submodule the .gitignore file ignores file.txt. That is very much logical for the submodule. But in my root I would like to add “file.txt” to the repo. Is that even possible? !submodule/file.txt Adding the line above to /.gitignore does not work. So for my […]

Git ignore except specific subdirectories

I’ve looked at some examples on how to ignore everything except certain sub directories like so. # Ignore Everything foo/* # Include sub directory !foo/ccc/* I have also tried: # Ignore Everything foo/* # Include sub directory !foo/ccc/ UPDATE So the code above works, however trying to exclude a directory within another directory within another […]

Gitignore not ignoring some build files in Android library

I have an Android library and for some reason, the files and folders I have specified in my .gitignore are not being ignored. I have tried modifying my .gitignore and also following these steps, but this doesn’t change anything. Here is my top-level .gitignore (which can also be found on the GitHub repo): # Gradle […]

How do I reset .gitignore

I have copied a previous project that has git allready in it. I have removed .git and .gitignore folders. Then reïnitialized git and generated a .gitignore file. Which is completely empty. But somehow the files ignored in the previous project still remain ignored in this new project… so when I run the command git clean […]

Get git not to ignore directory after wildcard ignore

I have the following in my .gitignore: * !.gitignore !.gitconfig !.vimrc !.bash/ !README.md I would like git to track everything in that .bash/ directory, but it seems to be ignoring it, but tracking everything else. I have also tried !.bash/*, but that didn’t work. What’s the trick to get this working?

Gitignore Exceptions Not Being Added to Tracking

I have the following in my .gitignore: *.log /bower_components/* /node_modules !/bower_components/v-accordion !/node_modules/todomvc-app-css/* I added the last two lines after I installed those components, so that may be the issue, but I cannot tell. Either way, I would like to track changes to those directories as I am actively customizing them and pushing to production. However, […]

Why .gitignore not working for the new project in Android Studio?

I created project in Android Studio with .gitignore file. .DS_Store # built application files *.apk *.ap_ # files for the dex VM *.dex # Java class files *.class # generated files bin/ out/ gen/ # Libraries used by the app # Can explicitly add if we want, but shouldn’t do so blindly. Licenses, bloat, etc. […]

Include generally excluded file from specific folder

In my project, I have generated files Widget.js in project subfolders, so I git-ignore them with this rule: widgets/*/Widget.js so it ignores files like: widgets/ignore_1/Widget.js widgets/ignore_2/Widget.js But now, in one specific folder, I want to include this file to repository. E.g.: file widgets/include_1/Widget.js should be included. Is there any possibility to set the rules as […]

gitignore file is ignoring the wrong directory

I have a simple directory structure: gitroot/ └── docker/ └── critical_dependencies/ I would like to just ignore the entire contents of the critical_dependencies/ directory. My .gitignore file has the following entry: docker/critical_dependencies/* It doesn’t seem to be ignoring any of the folders that are in that directory. What is the proper way to ask the […]

.gitignore – ignore file starting with ~

To ignore any file starting with ~(tilde), I put following in gitignore file ^~.* But, it is not working for the file name starting with ~(eg. ~$ofession email.docx). There is no issue with gitignore configuration setting as other patterns are working well. What is wrong here with the regular expression?

Git Baby is a git and github fan, let's start git clone.