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 […]
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 […]
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 […]
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 […]
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?
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, […]
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. […]
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 […]
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 […]
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?