I’ve been reading on Stack Overflow about using gitignore to ignore everything except specific files. I’ve tried a bunch of different suggestions, but I can’t get it to work for me. Here’s what I’m trying to do: I want to exclude everything except one file in my main directory and a couple other files in […]
I supposed this to do the trick: * !/dir1/ !/dir2/ !/file1 !/file2 But to my surprise, it didn’t. It seems to work if I prepend a slash before the asterisk. But I don’t really understand why it doesn’t work before this change. Could anybody point out?
For various reasons, I have the entry in my .gitignore in the root of a project: *.c As I desire, this ignores all C files from being included. However, I really only want the C files to only be ignored in the root directory, and not all the sub-directories: foo.c bar.c folder/baz.c In the above […]
I have the following folder structure for my project src/ test_unit/ package1/ test_unit/ package2/ test_unit output/ In my devel branch all folders should be version controlled, but the master/stable branch should ignore and not merge test_unit/ and output/ folder. How can I achieve this? With .gitignore it won’t work because .gitignore will be merged between […]
I’m working with Rails and added the directory tmp and the Gemfile to my .gitignore. But every time I change it, git status tells me, that it changed. On both machines. On my developer machine and on the server. Kind of annoying. Contents of .gitignore: .DS_Store data/export/*.csv tmp/* *.rbc *.sassc .sass-cache capybara-*.html .rspec /.bundle /vendor/bundle […]
Is there a way to validate a .gitignore file so you quickly find doubles paths or paths that don’t exist anymore? Normally when a project is small this isn’t really necessary but with lots of branches and mergings of .gitignore files this can come in hand.
I have a project in which all development is done at some directory depth, and so I’m used to cd-ing to a second-level directory and write some temporary files there. The tree looks like this: repo .git/ project/ dev/ important_stuff/ more_stuff/ README prod/ important_stuff/ more_stuff/ README temp_1.txt test.cc I would like to git-ignore exactly files […]
I have a folder foo that is included in gitignore: – .gitignore (this contains ‘foo’) – foo * *** bar When I run git clean -f or git clean -f -x, this does not delete bar (bar is a normal file). Is there a way to tell git to clean inside ignored folders?
My global .gitignore is generally great but for this one off project I don’t want the global rules applied. How can I remove the global .gitignore rules for this one freak repository?
So lets say I have a directory structure like so uploads/ –dir1/ —-one.txt —-two.txt —-dir2/ ——one.txt ——two.txt I would like any directory and sub directories of uploads to be tracked but not any files in it with the exception of a dummy file because git doesn’t track directories. I would think something like this would […]