Tag: gitignore

Ignore .classpath and .project from Git

I keep myself telling me and others not to commit .classpath and .project files and use Maven. Somehow, Junior developers always ignore certain rules and commits those files and it’s much better to have such files for newbies who can jump and start using the code. Now from myside, I would like to try/do something. […]

Apply gitignore on an existing repository already tracking large number of files

I have an existing Visual Studio project in my repository. I recently added a .gitignore file under my project and I assume that tells Git to ignore the files listed in the file. My problem is that all those files are already being tracked and as far as I know Git will not ignore a […]

git add adding ignored files

I’m trying to remove a previously tracked directory from git, which works, but it’s being added back with each subsequent git add ., git add -A, etc. Here’s what I’ve done: Add to .gitignore in root of project: node_modules Run the following: git rm -r –cached node_modules git commit -a -m “removed node_modules” git push […]

How do I tell Git to ignore a specific filename only in the repository's top level?

Possible Duplicate: How to exclude file only from root folder in GIT For a specific JavaScript project, I am using the TinyWeb HTTP Server for local testing (to work around a specific security limitation that applies to file URLs). That program requires I have an index.html file in the root directory, but I do not […]

Difference between .gitignore rules with and without trailing slash like /dir and /dir/

Is there a difference between /dir and /dir/ in the .gitignore file within a Git repository? How are the following different? /dir /dir/ /dir/*

gitignore does not ignore folder

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

GIT — Exclude / Ignore Files from commit

This question already has an answer here: Untrack files from git temporarily 9 answers Can I 'git commit' a file and ignore its content changes? 4 answers

How to .gitignore files recursively

I’m trying to avoid the following pattern in my .gitignore file. MyPrject/WebApp/Scripts/special/*.js MyPrject/WebApp/Scripts/special/*/*.js MyPrject/WebApp/Scripts/special/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*/*/*/*.js We tried: MyPrject/WebApp/Scripts/special/**.js MyPrject/WebApp/Scripts/special/**/*.js This however didn’t work. This is git on Windows. Is there a more concise way to do this without repeating things?

Best Practice for Adding .gitignore to Repo

What is the best practice regarding the .gitignore file with Git; should it be excluded from the repository or included? If it’s conditional, what are the conditions for each circumstance?

.gitignore NuGet exclude packages/ include packages/repositories.config

I’m trying to create a .gitignore for a Visual Studio project that uses NuGet. It currently contains: \packages/* !packages/repositories.config This does not ignore anything in the folder. Everything gets staged on an add. I have also tried: packages/ !packages/repositories.config This ignores everything in the packages folder and does not include the packages/repositories.config. What am I […]

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