Visual Studio not showing Git commit options in context menu
Asked Answered
F

5

12

I have an existing Bitbucket Git project and I have installed Visual Studio Tools for Git from here

My visual studio didn't show any thing at all to signify I'd done this until I went into tools>options>source control and changed it from none to "Microsoft Git provider"

Now my solution explorer shows little padlocks and ticks in the right places but when I right-click there is nothing at all to do with commiting or anything to git

When I create a new project I don't have the option to create a new git repository either.

I am using Visual Studio 2012 and have tried installing all updates and repairing the tool but still no joy.

Does anyone know what's happened?

Fertile answered 21/10, 2014 at 12:2 Comment(5)
Were you able to resolve this? I am observing this on VS2015.Poacher
@ScottNimrod Nope! Just living with it and checking in via the folder.. taking too much time to look in toFertile
I am seeing this even in v2019 must have been an old bugMeeker
The current missing feature affects the latest VS19 release 16.7.1. Being looked into: twitter.com/VisualStudio/status/1295357212731281408 developercommunity.visualstudio.com/content/problem/1152319/…Tradein
VS2019 BUG. Workaround described here developercommunity.visualstudio.com/content/problem/1141222/…Kone
H
16

I had the same issue, and I get the context menu in some directories and not others. I was able to check-in using the technique below, but I also would like to get the context menu for "Commit" and "Add".

Try going to "Team Explorer" tab, then under "Project" click the "Changes" icon. enter image description here

That should list all the files you have added (highlighted in yellow below). Enter a commit message then "Commit" or "Commit all".

Update: A few minutes later in Solution Explorer, I now see the Commit/Undo options. Seemed to be a delay before they appeared.

enter image description here

Holofernes answered 7/4, 2020 at 17:37 Comment(7)
Thanks for that answer, it works! Any idea / clarification on the following: - why does it disappear in the first place? - why does it work via the "Changes" section and inserting a message? This actually commits and pushes the previous uncommitted changes. - why and how does it suddenly reappear once one performed these steps? -- Is it a visual bug Visual Studio encounters? -- Are there problems with the local repository? -- Something not right with the GitHub repository? Thanks for anyone willing to provide some clarity!Hoelscher
Sorry, I don't know.Holofernes
While yes @Holofernes that is correct the commit command is on the solution explorer even in 2019 but now seems to have been removed in last update.Meeker
that not the point @Holofernes this is ment to work from the solution menu has for yearsMeeker
This happened again in vs 2019 16.7.1, this answer resolved my commit issue. I was too dependant on the context menu option.Petree
You can get there with the shortcut CTRL+0, G (that's zero)Chekiang
Thank you, it fixed it for me in VS 2019. The first step is really what I was missing, everything else is as usualBlackmore
C
4

There's a shortcut to git "commit" on the Visual Studio status bar near the branch control. It shows you how many changes there are to commit too.

enter image description here

Chekiang answered 21/8, 2020 at 7:26 Comment(0)
A
3

I believe you have to clone your repository from GitHub in order to get the commit context options. I had this same issue and had to use the GitHub desktop app to commit changes or use Team Explorer is VS. I committed everything I had, deleted everything I had locally and then cloned it from GitHub. I now have the commit option available via the context menu.

EDIT: I have also noticed that if you have the "Show all files" button selected in VS the commit context disappears. If you de-select show all files, you are able to access commit again.

Artemus answered 17/4, 2016 at 17:2 Comment(0)
H
1

I have the same issue here. Sometimes it is displayed sometimes it is not. Now I am using TortoiseGit with TortoiseGitToolbar visual studio extension. It provides a great toolbar and also you can pull/commit changes outside the solution directory.

https://github.com/MRCollective/TortoiseGitToolbar

Heavily answered 21/3, 2017 at 15:30 Comment(1)
Same even in 2019Meeker
D
0

You have to go to the Team explorer tab and change your foundation server (by default it is one from microsoft) change it to git

Duntson answered 21/3, 2022 at 8:57 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Wolfgang

© 2022 - 2024 — McMap. All rights reserved.