Questions tagged [ignore]

Many source control systems have an "ignore"-file mechanism that specifies files that should not be committed or tracked in version control. Use this tag for questions about ignoring or excluding files from version control systems. DO NOT USE THIS TAG FOR QUESTIONS ABOUT "IGNORING" THINGS IN OTHER CONTEXTS.

Many systems have an "ignore"-file mechanism that specifies files that should not be committed or tracked in version control. Typically, patterns are added to a text file (e.g. .gitignore or .hgignore).

For VCS-agnostic questions, such as whether certain types of files should be checked into source control, use this tag. For questions that are specific to one VCS's ignore mechanism, also use one of the more specific tags , , or if appropriate.

343 questions
2815
votes
14 answers

How do I make Git ignore file mode (chmod) changes?

I have a project in which I have to change the mode of files with chmod to 777 while developing, but which should not change in the main repo. Git picks up on chmod -R 777 . and marks all files as changed. Is there a way to make Git ignore mode…
Ro Marcus Westin
  • 28,490
  • 4
  • 18
  • 11
1793
votes
14 answers

How do I configure git to ignore some files locally?

Can I ignore files locally without polluting the global git config for everyone else? I have untracked files that are spam in my git status but I don't want to commit git config changes for every single little random untracked file I have in my…
Bjorn
  • 69,215
  • 39
  • 136
  • 164
833
votes
12 answers

Git command to show which specific files are ignored by .gitignore

I am getting my feet wet with Git and have the following issue: My project source tree: / | +--src/ +----refs/ +----... | +--vendor/ +----... I have code (currently MEF) in my vendor branch that I will compile there and then move the references…
Andrew Burns
  • 13,917
  • 9
  • 40
  • 42
710
votes
13 answers

How to git ignore subfolders / subdirectories?

I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein. .gitignore with "bin/" ignores "Debug"…
Marcel
  • 7,909
  • 5
  • 22
  • 25
637
votes
11 answers

How to remove files that are listed in the .gitignore but still on the repository?

I have some files in my repository that should be ignored, i added them to the .gitignore but, of course, they are not removed from my repository. So my question is, is there a magic command or script using filter-branch that can rewrite my history…
Intrepidd
  • 19,772
  • 6
  • 55
  • 63
476
votes
2 answers

Git diff -w ignore whitespace only at start & end of lines

I love to use git diff -w to ignore whitespace differences. But, I just noticed that it ignores even whitespace differences in the middle of lines. How could I only ignore whitespace differences that come at the start (^) or end ($) of lines?
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
352
votes
3 answers

Should I add the Visual Studio 2015 .vs folder to source control?

Visual Studio 2015 creates a new folder called ".vs". What is the purpose of it and should I add it to source control?
SoftwareFactor
  • 8,430
  • 3
  • 30
  • 34
288
votes
13 answers

git ignore vim temporary files

What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)?
jrdioko
  • 32,230
  • 28
  • 81
  • 120
244
votes
2 answers

How to tell git to ignore individual lines, i.e. gitignore for specific lines of code

.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 them before committing. I'd like to just keep…
Kache
  • 15,647
  • 12
  • 51
  • 79
209
votes
6 answers

Ignore modified (but not committed) files in git?

Can I tell git to ignore files that are modified (deleted) but should not be committed? The situation is that I have a subdirectory in the repo which contains stuff I'm not interested in at all, so I deleted it to prevent it showing up in…
John Doe
190
votes
9 answers

Git - Ignore files during merge

I have a repo called myrepo on the remote beanstalk server. I cloned it to my local machine. Created two additional branches: staging and dev. Pushed these branches to remote as well. Now: local remote server …
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173
153
votes
12 answers

How can I delete all unversioned/ignored files/folders in my working copy?

If I have a working copy of a Subversion repository, is there a way to delete all unversioned or ignored files in that working copy with a single command or tool? Essentially, I'm looking for the SVN analogue to git clean. Either a command line or…
Nick Meyer
  • 39,212
  • 14
  • 67
  • 75
132
votes
10 answers

Is there an ignore command for git like there is for svn?

I am a new user to git and I am starting a new project. I have a bunch of dot files that I would like to ignore. Is there an ignore command for git like there is for svn?
Chris J
  • 9,164
  • 7
  • 40
  • 39
110
votes
14 answers

SVN: Ignore some directories recursively

I don't want any directory named build or dist to go into my SVN no matter how deep in the tree it is. Is this possible? In git I just put build dist in my .gitignore at the root and it recursively ignores. How do I do this with svn? Please don't…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
103
votes
10 answers

Can you "ignore" a file in Perforce?

I sometimes use the feature 'Reconcile Offline Work...' found in Perforce's P4V IDE to sync up any files that I have been working on while disconnected from the P4 depot. It launches another window that performs a 'Folder Diff'. I have files I never…
Ray
  • 187,153
  • 97
  • 222
  • 204
1
2 3
22 23