.tfignore files on existing files - version-control

I've added a .tfignore file to my solution but it isn't doing anything.
I'm pretty sure my statements in the ignore file are correct but I'm wondering.
Is it correct to place the file as a solution item or should you have a .tfignore for each project?
Does .tfignore work with VS 2013?
Can a .tfignore file handle existing items, because this is the case.

.tfignore works with VS2013 however rules only apply to new files.
Existing files that you have already added to source control (or have in your pending changes list) won't suddenly get removed or ignored, because they're already under version control.
The .tfignore file applies to files in the folder it is in, and any subfolders under that.

Related

VSCode Explorer always excludes files in .gitignore

Using VS Code 1.74.2, any files or folders in .gitignore are excluded from the File Explorer tree. None of the solutions seen on the web work...
"explorer.excludeGitIgnore": false, doesn't work
files: exclude doesn't work
Isn't .gitignore meant to indicate files and folders you don't want in the repository? If yes, then why does it also remove them from the VS Code file explorer. What can I do to stop files and folders going into the repository but still have them visible in the File Explorer tree?
Thanks

Excluding a folder in .gitignore

I am trying to exclude a folder in my project and have added the following lines to the .gitignore:
logs/
tempStorage/
libraries/lib/
The first two are excluded but the last one is still being updated. That folder contains DLLs that are generated by another project in the solution.
I am using Visual Studio 2022. When I rebuild the solution the project target lib updates the DLLs. I don't want to store these in git.
Do I need to do something in git like delete the files?

How to ignore files via GUI in Gitkraken?

I come from SourceTree to board the GitKraken hype train. It has always been pretty easy to ignore files within ST. Just right-click on a file in the unstaged container and you've all the options. You can ignore the files directly, each file beneath a specific folder etc. (so, all the .gitignore stuff from within the GUI =)).
However, I can't find a similar feature in GitKraken. Does anybody know how I can ignore files via the GUI of GitKraken?
Please note: This is not a git question. I absolutely know in depth how ignoring files in Git work. But that's not the topic whatsoever. This is just a trivial GitKraken support question.
Currently there isn't an option to ignore a file through the GitKraken GUI.
If you check their post on twitter this is planned to be implemented soon and it will be in their release notes once this is completed.
UPDATE (26.01.2017.):
Version 2.0.0 brings the .gitignore option to the list of functionalities. You can now select a file or folder in the file staging area, and add to the .gitignore file on the fly. Right-click and select Ignore. From there, you can:
Add that specific file to .gitignore
Add all files with that file extension to .gitignore
Add all files in the same folder as the selected file to
.gitignore
(If selecting a folder) add that folder to the .gitignore

What should be my gitignore with Microsoft Fakes?

I'm using Microsoft Fakes and Git. There are files in FakesAssemblies which change all the time (.fakes.dll, .fakesconfig, .messages, .xml). Which of these can I exclude in my gitignore. If I exlude everything, my build server blows up saying it can't find the files.
All the items in the FakesAssemblies subfolder would be regenerated on rebuild so all of those can be ignored out.
The Microsoft.QualityTools.Testing.Fakes is definitely needed.
Your csproj would have references to the .fakes files in the Fakes subfolder which are also required.
A simple way to verify if this is true is just delete the FakesAssemblies subfolder and rebuild.

Where to put .hgignore?

I'm wondering where to put .hgignore file; in the main repository or each programmer should have it on his cloned copy?
Please clarify. Thanks.
You should put the file at the root of your repository.
See :
https://www.selenic.com/mercurial/hgignore.5.html
https://www.mercurial-scm.org/wiki/.hgignore
It says:
These files can be ignored by listing them in a .hgignore file in the root of the working directory. The .hgignore file must be created manually. It is typically put under version control, so that the settings will propagate to other repositories with push and pull.
Also another advantage is that, you might be working on multiple projects. Each having it's own set of pattern of files to ignore. For example, working on a Visual Studio project or a simple C++ project or a Python project. This ensures that patterns to ignore are relevant to the project.
How ever, you may not want to replicate these patterns in every ignore files. In such a case Mercurial configuration file can reference a set of per-user or global ignore files.
Example for global ignore files
in ~/.hgrc1:
[ui]
ignore = ~/.hgignore
in ~/.hgignore:
syntax: glob
*.tex
*.R
1 On Windows: %USERPROFILE%\mercurial.ini, ~ refers to %USERPROFILE% on Windows.
I've never seen it anywhere but the main repository.
How are you going to ignore the .hgignore without an .hgignore file in the repositry to ignore it ;P
Seriously.. it should probably be in the repository, since the files to be ignored are respositry-specific; a user can of course specify their own ignores additionally in a file specified in their .hgrc
you can have a global one inside your ~/.hgrc directory or a project specific one inside
the project's root directory
It belongs in the top folder of the repository. It is not meant for personal ignores but for project-wide ignores (i.e. applying for everyone). However, usually developers will add e.g. their faviourite editor's temp. files to that file - doesn't hurt anyone.
If you want to ignore something others probably do NOT want to ignore, put it in your personal ignore in ~/.hgrc.