Commit confusion when using git in Visual Studio 2010 - visual-studio-2010

I just began to use git in Visual Studio 2010, but here comes a question. I followed some tutorials on the Internet. But after commitment, my code files marked by lock marks instead of green check marks. Then, I ignore this problem and continue to push it. But when I push it, a message box show up to remind me that "The branch master does not have tracking reference. Do you want to add a tracking reference to master?". I clicked "Yes" option and continue to push. Naturally, I couldn't push the project to the remote. So, is there anyone who can help me? Thanks a lot!

Related

Reverting back to a specific changes after saving in Visual Studio 2019

In my project in Visual Studio 2019, I opened a file and made some changes. After running it, I decided to undo(ctrl + z) my changes and revert it back to the original point where I opened it and do some other code again to verify my changes. After saving and running my code, I decided to revert it back to the point where I made my first changes. And now, I cannot revert it back anymore. I tried to search it online but had no luck. Is there a way to revert my first changes back? Thanks in advance for your help.
Ctrl-Y is Redo, which is the opposite of Ctrl-Z Undo.
I would suggest creating a Git repository. You can commit versions of your code and revert to any of your previous versions.

Why does CodeLens always show "0 authors, 0 changes"?

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.

How to undo changes in Visual Studio when syncing with Github using GitHub extensions for Visual Studio?

I am trying to get new changes from my fork on GitHub. I have the solution open in Visual Studio 2015 and I am using GitHub extensions for Visual Studio. I am getting a message to commit my changes or undo them. I don't know what these changes are and I want to undo them. How do I find them and undo them?
I don't see entries in outgoing commits. The Output window is empty.
Git forbids most operations when there are uncommitted changes in your repository. This simply prevents data loss.
You can find all uncommitted changes in the Team Explorer - Changes
There you can Undo all your changes.

Missing the "Detect changes" link in visual studio 2012 team explorer

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.

Visual Studio 2010 - automatic git commit, push when file is saved

Is there a way to have Visual Studio 2010 automatically commit a file and push it to a git repository when the file is saved?
I would like to be able to have a pop up box appear to allow me to write the commit message on save. I feel that this would force some good habits on me, because sadly I can miss a day or ten of commits on occasion and as I am the sole developer this isn't a job requirement here.
From a configuration manager point of view I completely disagree with your "always commit" policy.
Insted, I don't know if have you tried Visual Local History 2005. I've used it in the 2005 and 2008 versions, but I've never tried with the 2010 version. It simply create a subdirectory and save there a local copy every save you make. So you could watch the history per-file.
THEN you could commit at the right point (when it really makes sense).
Let me know if it works as you would.

Resources