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. […]
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 […]
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 […]
Is there a difference between /dir and /dir/ in the .gitignore file within a Git repository? How are the following different? /dir /dir/ /dir/*
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. […]
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
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?
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?
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 […]