A standard practice to create repository should always be;
Main branch should always have a .gitignore and readme file.
Create a working branch from main
Develop feature in your working branch
Before committing, do a merge from remote main to working branch and resolve any conflicts in working branch. This will help you to get team changes merged into your working branch.
Commit your changes. Create a PR and you are done.
Recently I came across an issue where existing projects were showing .vs folder checked-in and being tracked. Developers were having code conflict problems and were not able to create PR request.
Here is the work around to add gitignore file in existing solution using Visual Studio.
Remove .vs folder from main branch and working branch. If there are PR policy in place, disable that for fixing this. After .vs folder removal, enable PR policy.
Open Visual Studio and make sure it’s connected to Git branch. Click on Git->Settings.
This will add gitignore file in the root of project folder. Switch to Git changes window in your working branch and commit / sync your changes.
Now we need to stop tracking all .vs folder changes that’s been created on developer machines to build and run the project. Use these magic commands, one time only;
For added piece of mind, sync your main branch and do a merge from main branch to work branch locally. Resolve any cache files and conflicts. You might need to run above three command again.
After this, Create PR and it should merge with main branch. This will take your pain away.
My problem, I was opening a solution from the internet and the original author had forgotten to remove the TFS bindings, so every time I open the solution I’d get an annoying popup saying “binding…”.
To get rid of this, I deleted the .suo next to the .sln file, and then opened the .sln file in Notepad and deleted this entire section:
One of my developer started getting Git Credential Manager for windows popup and received Authentication failure message. The work around was;
Check the Git for Windows in the Tools – Get Tools and Features…), go to “Individual Item” tab, check “Git for Windows”, and click “Modify”. Then it will ask you to update vs2017 to latest version, for example 15.9.36.