I have a Visual Studio project/solution in a Git repo. Visual Studio's source control feature works a treat (second screenshot). Thanks "Microsoft Git Provider"
HOWEVER CodeLens shows "0 authors, 0 changes" for every class and method (first screenshot) with tooltip explanations:
no data available for this type
no data available for this method
Any ideas why it could be broken?
More detail: the git repo doesn't have remotes. Visual Studio isn't connected to any Team Foundation server. I'm using the exact version of Git that shipped with Visual Studio 2015 update 1.
>git --version
git version 2.6.2.windows.1
I came across the same issue in VS 2017. The fix was to change "Changes in months" field. If you left click on "0 authors, 0 changes" link, a pop up will appear. It has a field in the bottom right corner which you could adjust. I changed it from 12 months to 48 months. The change was automatically applied to the whole solution.
I had the same problem. Tried re-installing GIT, etc. Finally, I decided to uninstall and reinstall VS 2015 with update 1, and that corrected the issue.
Visual Studio 2015 Update 2 fixed my problem.
https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx
I think the issue is not having a remote repo.
In this case without a remote repo, it won't even show up authors or changes above methods, but will show in history.
For my projects that did have a remote repo and the remote repo has since been removed it is working as intended.
The docs say that the info is taken from the local repo, but there must be some initialisation that works on the premise that there is a remote repo.
Git – CodeLens gets its indicator information from your local repo, so it doesn’t matter where your remote is. It could be Team Foundation Server, Visual Studio Online, Github, Gitorius, you name it.
Having difficulty finding out exactly, it would seem that this is linked to the remote repo.
Also the majority of my projects are not connected to TFS.
Related
The "Git for Windows (32 bit)" process makes Visual Studio 2019's CPU usage high which bugs me because I have multiple programs open at a time, so my PC lags. I've looked up on how to disable git on Visual Studio 2019, Tried the solutions on this link, but they didn't seem to work. My Visual Studio 2019 version is 16.6.0.
Disabling git via going to Tools / Options / Source Control / Plug-in worked thanks to #dxiv's comment, I didn't know because I was looking at old answers.
I found that I was able to solve this issue by removing the .git folder that was in my user root directory. It was C:\Users\MyUserName\.git I don't know where it came from. It did not correspond to any of my legitimate GitHub repositories. It was large and seemed like it was constantly trying to index and prepare my entire user directory to push to a remote repository that did not exist.
This also resolved other ways the seemingly same issue presented itself in both VS2019 and VS Code.
Just delete the c:\users\yourusername.git folder and VS will stop showing GIT in Team Explorer.
I have a WebJobs project that I've been working on in Visual Studio 2017 for some time. The solution is also checked into a repository on VSTS.
I also have Visual Studio 2017 Preview version installed on my computer and I mistakenly opened my WebJobs projects in this version.
First, I noticed that my solution was no longer bound to the repository and I could not check my code in.
I then opened the solution in stable version of Visual Studio 2017 and click "Add solution to source control". When I look at the binding, it seems to be pointing to the right repository but under "Pending Changes", I don't see all the changes I've made to the project.
Is there a clean fix to this? Otherwise, I'll kill the repository on VSTS, create a new one and do a clean check-in. I'd hate to go through that process though if I can fix the problem.
UPDATE:
When I click "Workspaces", I see my computer's name and "Workspaces..." options and if I select "Workspaces...", I can see all them on my computer. In the "Edit" view, they even seem mapped correctly. But as you can see in the image below, it shows the "Local Path: Not Mapped".
Please suggest the option of Uninstalling the GIT Source Control Provider. I've never used it and have used TFVC for many years. I have no intention of ever using GIT but today when I added a project to source control it went to GIT instead of TFVC even though my default provider was and always has been Visual Studio Team Foundation Server
I've never used it and have used TFS for many years. I have no intention of ever using GIT
Don't presuppose of the future! 😉
There is a big switch movement for a reason (even Microsoft switched to it internally). Perhaps you should have a careful look at it because it brings a lot more flexibility and other things that could improve your development workflow.
Also FYI, the right term is TFVC, not TFS (which is the whole ALM solution and that could host TFVC or git repositories) .
Anyway...
You must not uninstall git tool but uninstall git plugin of visual studio. There are some solutions proposed (remove some registry keys or rename extension file) here:
How can you disable Git integration in Visual Studio 2013 permanently?
I'm was looking for the proper way to exclude folders/files from team foundation server (2012) using visual studio 2012. I found:
how-to-exclude-certain-folders-from-visual-studio-2012-detected-changes-list on stackoverflow. However the shown detect changes link is missing in my team explorer. There should be a detect changes link in the red circle as compared to the screenshot in the linked question
I could not comment on the original question to ask this, so I made a new one. Does anyone know where the detected changes link went. (and yes the project had pending changes when I tested)
That's not a verb ("detect changes"), it's a noun: "detected changes". Which are changes that were found on the filesystem by watching your activity, but will not be included in the checkin.
This occurs when you use a local workspace. You will not see it if you are using a server workspace, since you must pend changes manually.
If you have changes that were made on the filesystem that were not pended, and you would like to detect them, run tfpt online from the TFS Power Tools. Or convert to a local workspace, and find them in the detected changes tab.
I've been working with several projects I have hosted on GitHub, but recently I haven't been able to check in any changes. Every time I save a file, VS treats the file as if it's checked in, lock icon and all. I can't make any commits because of this. I've had this occur in VS2013 Community, VS2013 Pro, and VS2015 Ultimate CTP. While restarting VS works in the 2013 versions, it does not work in 2015.
While searching for an answer, I came across this SO question. The answer did not work for me, as I am using GitHub, not TFS with a Git project ("Connect To" wouldn't show my project). In addition, I have not renamed any of the projects that have had this glitch. Is there anything I can do besides report the bug to MS?
To all the people which have this kind of problem using Visual Studios Git Source control.
One solution which worked for me since all other i found failed was to create a .gitignore file via Visual Studio. This somehow stopped the automatic check in which happened during a filesave.
Team Explorer -> Settings -> Repository Settings -> Ignore & Attributes section -> Ignore File -> Add
I am currently using Visual Studio 2015 update 1.