Tag: gitignore

Git ignore the deletion of a tracked file

scenario I’ve a folder /build that is regenerated at each build process. This folder needs to be versioned and the content must be excluded, so in the .gitignore I’ve added build/* and a /build/.gitkeep to be able to add the folder. problem When the content is generated it deletes the .gitkeep file that was previously […]

Make git ignore file changes

This question already has an answer here: How to make Git ignore changes I'm making to a file (under source control)? 2 answers

Gitignore a nested directory structure anywhere in my repository

Pretty sure no one’s asked about this exact pattern yet… I have some (untracked) auto-generated config files that I’m trying to ignore: ?? PanDA/dp_ptu/cfg/cpp/ ?? RCMB/cfg/cpp/ (The cpp/ folder is auto-generated but there are other files inside cfg/ that need to be committed.) So I’ve entered the following in my .gitignore: cfg/cpp/ But it doesn’t […]

gitignore: !text.lib (exclude) vs *.lib (ignore)

I have question regarding ignore and exclude rules in .gitignore. So I have a very large file tree where I want to ignore all lib files except a specific lib file which is a text file with a .lib extension: What I have in my .gitignore file: # exclude rule !text.lib # ignore rule *.lib […]

Coda 2 still publishes files in .gitignore

I use git for source control in coda 2. I have one file that I need to be different on my local machine, but even when I include it in .gitignore, coda still pushes it to the master. The reason I need to ignore this file, is because it references localhost rather than for […]

Gitignore GLOB pattern to track files without file extension

I want to track the files which have no file extension. I am using following .gitignore file .gitignore *.* # THIS CATCHES EVERYTHING !*.asm # I TRIED THE BELOW directives #*.\d{1}* #*.[?]* #*.[?*] Point me in the right direction!

What is the exact impact of following content of `.gitignore` file in one of subdirectories?

What is the exact impact of the following content of .gitignore file in one of the subdirectories: * !.gitignore

Confusion on gitignore file tracking

I’m having trouble understanding exactly how the .gitignore file works. Say I have the following .gitignore: /db/*.sqlite3 /log/*.log /public/uploads/* On all of my computers, I have a file /db/development.sqlite3 My questions are: If the file is already in the repository, will it pull down the version in the repo every time I git pull? Do […]

git assume-unchanged and git stash

I keep some of my local configuration in assume-unchanged files. I have several branches created over time, and assumed-unchanged files have evolved in between (adding more local config). If I try to checkout an older branch, I get: error: Your local changes to the following files would be overwritten by checkout: <some assume-unchanged files> Please, […]

How to add sub node_modules to .gitignore?

Basically I’ve created a new repository for small features that my team uses in several projects. The structure is the following: [feature1] |– [node_modules] [feature2] |– [node_modules] 1) How can I add all the node_modules inside each feature (same repository for all of them) ? I’ve tried : */node_modules/ *node_modules/ 2) Is there a way […]

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