gitignore binary files that have no extension
How can binary files be ignored in git using the .gitignore file? Example: $ g++ hello.c -o hello The “hello” file is a binary file. Can git ignore this file ? 18 Answers 18
How can binary files be ignored in git using the .gitignore file? Example: $ g++ hello.c -o hello The “hello” file is a binary file. Can git ignore this file ? 18 Answers 18
My programs generally generate huge output files (~1 GB) which I do not want to be backing up to the git repository. So instead of being able to do git add . I have to do something like git add *.c *.cc *.f *.F *.C *.h *.cu which is a little bit cumbersome… I feel … Read more
Is it possible to add the .gitignore file to .gitignore itself? .gitignore Doesn’t work though I don’t want to see it in edited files 5 Answers 5
I am a bit confused about the pros and cons of using .git/info/exclude and .gitignore to exclude files. Both of them are at the level of the repository/project, so how do they differ and when should we use .git/info/exclude ? 4 Answers 4
In the root of my project I have a foo folder. Inside the foo folder I have a bar folder. I would like to ignore all changes to all files inside my bar folder. I have this in my gitignore: /foo/bar The folder is checked: it exists and it has the files to be ignored. … Read more
This question already has answers here: Can git ignore a specific line? (9 answers) Closed 7 years ago. .gitignore can ignore whole files, but is there a way to ignore specific lines of code while coding? I frequently and repeatedly add the same debug lines in a project, only to have to remember to remove … Read more
I just created a Github repository and was wondering what the .gitignore file was for. I started by not creating one, but added one due to the fact that most repositories have one. Do I need to have one? Can/do I just ignore it, or does it have a use? 6 Answers 6
I have a directory structure like this: root folder1 abc.json def.json somedir more.json folder2 qwe.json rty.json spec mock1.json mock2.json somedir more_mocks.json Now using a .gitignore I want to ignore all *.json files except for the ones in the spec. I don’t want to use a .gitignore in folder1 and folder2 because there are a ton … Read more
This question already has answers here: Make .gitignore ignore everything except a few files (27 answers) Closed 2 years ago. How can I add an exception to .gitignore, like “ignore all the .dll files BUT myfile.dll”? 5 Answers 5
I want to ignore all files in my repository except those that occur in the bin subdirectory. I tried adding the following to my .gitignore: * !bin/* This does not have the desired effect, however: I created a new file inside of bin/, but doing git status still shows nothing to commit (working directory clean). … Read more