Code Monkey home page Code Monkey logo

git-tools's Introduction

Git Tools and Git Tools 2019

Introduction

Git Tools is a Visual Studio extension that integration a few more git tools to Visual Studio 2013/2015/2017, including git changes window, graphical git history viewer and menus to launch Git Bash, Git Extensions and TortoiseGit.

Git Tools 2019 supports the new Visual Studio 2019 extension architecture. It is compiled from the VS2019 branch.

Please donate or support the project on Patreon. ๐Ÿ‘โค๏ธ๐Ÿ™

Donate

History

Git Tools and Git Tools 2019 are the successors of Git Source Control Provider.

Git Source Control Provider was the Visual Studio extension for Visual Studio 2008/2010. It integrates Git tools to Visual Studio as a source control provider since Visual Studio 2008 (Github Project) (InfoQ News). Starting in Visual Studio 2013, Microsoft has built the Microsoft Git provider into Visual Studio, but Visual Studio remains allowing only one active source control provider at a time. Git Tools is modified from the Git Source Control Provider to become a standalone extension. It is compatible with Microsoft Git and can run side by side with Microsoft Git.

Visual Studio 2019 has a new asynchronous extension architecture. Git Tools 2019 is modified from Git Tools to adopt the new architecture. It is compiled from the VS2019 branch.

Screenshot of Visual Studio 2017

main-menu-2017

Screenshot of Visual Studio 2019

main-menu-2019

For more information, please visit http://yysun.github.io/git-tools

How to Use

  • Install Git for Windows, Git Extensions (optional) or TortoiseGit (optional).
  • Run Visual Studio.
  • Go to Tools | Extensions, and Updates..., search the online gallery for Git Tools and install.
  • Select Top Menu 'Git Tools' or add 'Git Tools' toolbar to the main window.

Compile Source Code

  • Get source code: git clone https://github.com/yysun/git-tools.git
  • Open the solution and compile it in Visual Studio 2017
  • Or checkout branch VS2019 and open the solution in Visual Studio 2019

Pull requests are welcomed

Change Logs

5.0.0

  • Support Visual Studio 2022

3.0.0

  • Support Visual Studio 2019

2.0.0

  • Added advanced mode: displays un-staged changes and staged changes as two lists
  • Added advanced mode: allows stage/un-stage/reset by selecting line(s)
  • Improved Git Console autocomplete
  • Support git commit.template settings

1.6.0

  • Upgrade solution for VS 2017 RC, support VS 2017 RC

1.5.0

  • Performance enhancement: Use the background thread to refresh git changes
  • Performance enhancement: Use background thread to stage multiple files
  • Performance enhancement: Not to refresh if the changed files are ignored by git
  • Copy Dragon.exe to the Documents folder instead of the temp folder
  • Support VS community and Enterprise Editions
  • Bug fixes

1.4

  • Add git console

1.3

  • Add compare menu in changed file list to launch visual studio diff viewer
  • Add more context menu to git history viewer, e.g. init, stash, cherry pick, rebase, merge and etc.
  • Re-work on the refresh logic

1.0

git-tools's People

Contributors

asine avatar craigfis avatar ericsun-brps avatar lancehilliard avatar nightowl888 avatar rwing avatar yysun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-tools's Issues

How can I disable the file modification checking

When I modify my project file, this plugin will show my the code change, but it makes my vs2013 very slow, so I want to know how can I disable the file modification checking? So my vs2013 will faster as before.

Inconsistent Line Endings dialog pops up every time a file is selected/changed

Each time a new file is selected from the Git Changes window, it will display a dialog "Inconsistent Line Endings". This also seems to happen every time I do an edit.

Note that I am using the Git settings recommended for Windows development - that is, it will store them in Git cross-platform and convert the line endings to CRLF during checkout. I suspect that when the diff is run the same conversion is not taken into account.

lineendings

Bug with long pathnames

@yysun I use the new Gulp/Node tooling for client-side package management. This means I have a node_modules directory, and the directories in there are DEEP! Node is known for this.

My .gitignore file ignores that directory.

If I run a command (from VS or the command line, doesn't matter) that manipulates that directory, such as npm update, then Visual Studio crashes with the exception System.IO.PathTooLongException. If I disable this extension, the problem disappears.

So this extension is probably the cause. Why is it reading that directory if it is ignored, and why indeed is it reading any directory in so near to realtime?

This is a great extension as it provides features the VS git provider does not, but it's unusable in its current state. Now that the grunt/gulp/npm/node tooling has been added to VS, lots of people will run into this problem.

GitTools for VS2019, git changes diffs not showing

After install gittools for vs2019, diffs are not showed on git changes window.

It only shows this message for every changed file:

warning: CRLF will be replaced by LF in src/Api/Features/xxxxxxx/xxxxxxxxxxxxxController.cs.
The file will have its original line endings in your working directory

VS Version:
Microsoft Visual Studio Enterprise 2019
Version 16.1.4
VisualStudio.16.Release/16.1.4+29020.237
Microsoft .NET Framework
Version 4.7.03190

Installed Version: Enterprise

GitTools Version: 3.1.1

Git Changes Window Not Displaying

@yysun After the last update of Visual Studio 2019, I am no longer able to open the Git Changes window. I can perform any other action on the extensions menu other than that one. I really loved the visual representation and ease of use of your extension. Do you have any idea that would help debug the problem?

Here is a copy of the message that finally arrived a long time after the window finally appeared and sat blank for about an hour.

An exception was encountered while constructing the content of this frame.  This information is also logged in "C:\Users\EricDorothy\AppData\Roaming\Microsoft\VisualStudio\16.0_c0fc7721\ActivityLog.xml".

Exception details:
System.MissingMethodException: No parameterless constructor defined for this object.
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Microsoft.VisualStudio.Shell.Package.InstantiateToolWindow(Type toolWindowType, Object context)
   at Microsoft.VisualStudio.Shell.Package.InstantiateToolWindow(Type toolWindowType)
   at Microsoft.VisualStudio.Shell.Package.<>c__DisplayClass81_0.g__CreateToolWindowWorker|1()
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags, Object context, Guid persistenceGuid)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, Object context)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id)
   at Microsoft.VisualStudio.Shell.Package.<>c__DisplayClass91_1.<b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.d__68.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask`1.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Shell.Package.<>c__DisplayClass91_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Shell.ToolWindowCollection.ToolWindowListener.<>c__DisplayClass1_0.<<-ctor>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.AwaitExtensions.ExecuteContinuationSynchronouslyAwaiter`1.GetResult()
   at Microsoft.VisualStudio.Threading.AsyncLazy`1.<>c__DisplayClass13_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.AsyncLazy`1.GetValue(CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags, Object context, Guid persistenceGuid)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, Object context)
   at Microsoft.VisualStudio.Shell.AsyncPackage.Microsoft.VisualStudio.Shell.Interop.IVsAsyncToolWindowFactory.CreateToolWindow(Guid toolWindowType, UInt32 id, Object context)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.d__145.MoveNext()

Commit is blocked and requires multiple retries

First of all, thanks for a great extension to Visual Studio. I still prefer this over the 'Team Explorer'.

I'm not sure if this is an issue or just the way Git works.

Whenever I've navigated 'Git Bash' into the repository I'm not able to commit and get this error instead.

devenv_2019-09-26_13-47-50

'Team Explorer' is actually able to do the commit in this case.

Solution Explorer icons

I suppose with the Git provider removed, there is no way to bring back the alternate icon set for Solution Explorer, is there? That was always one the most important features of GitScc, and I'm very sad to see it go. Microsoft's choice of icons completely misses the point, and I was very happy to be able to get sensible icons in Visual Studio.

Navigation caret not visible

Using Visual Studio Professional 2019 with dark theme (or any other theme) the navigation caret not visible in the comment textbox, so it's hard to type messages and navigate through it.
image

Tortoise Git command names are wrong

In VS2019, Extensions > git tools > TortoiseGit > Commit shows Revert window.
Edit .Gitignore shows git log
And so on...
Windows 10.
TortoiseGit 2.8.0.0 (C:\Program Files\TortoiseGit\bin)
git version 2.20.1.windows.1 (C:\Program Files\Git\bin; C:\Program Files\Git\mingw64; C:\Program Files\Git\mingw64\etc\gitconfig; C:\ProgramData\Git\config)

"GitTools" menu has wrong hightlighting

Open the "GitTools" menu in VS 2015 CTP 6 and hover items with the mouse cursor. Then press the up/down arrow keys and now two items will be highlighted.

Also, open the GitTools menu, TortoiseGit subment and select a command like Commit. Cancel that and open the GitTools menu again. The "TortoiseGit" menu item is always highlighted and will always stay like that. The yellow background never goes away again.

Other menus in Visual Studio work fine so I assume some hacky custom menu drawing is performed here.

Compare Files

Hi,
I like your git-tools plugin very much. There is just one thing. If I click on "Compare..." the Visual Studio diff tool opens, not the diff tool I configured in my gitconfig.
In your source I have seen that you call:

internal IVsDifferenceService DiffService
        {
            get
            {
                return (IVsDifferenceService)this.GetService(typeof(SVsDifferenceService));
            }
        }

But is it possible to use the default git diff tool?
Btw this works quite well in Team-Explorer....

Kind regards,

Bernd

Plugin is always active, and slows down Visual Studio when using SVN

When the Git-Tools extension is enabled, and Visual Studio is working with projects controlled by SVN, the system becomes very unresponsive.
Changing tabs and scrolling is very slow, and the code editor has major lag.

A look in SysInternals Process Monitor (procmon.exe) shows some slow actions, related to missing .git files. -> http://technet.microsoft.com/da-dk/sysinternals/bb896645.aspx

After disabling the Git-Tools extension, Visual Studio is back to normal.

Misleading info about file with both staged and unstaged modifications

For a file with both staged and unstaged modifications, Git Changes shows one item for the file, with Modified status, which is misleading, because this status is shown for unstaged files, and Staged is shown for staged files.
Besides, the modifications shown at the Diff View are both from staged and unstaged changes.

I would be very useful for me if I could have two different items at the left pane for this case:

  • one with unstaged changes, marked as Modified, and wich shows at the Diff View the same as git diff <file>;
  • the second with staged changes, marked as Staged, and which shows at the Diff View the same as git diff --cached <file>.

Hope this is not so difficult to implement.

A feature I'm really after is the ability to select lines to stage, as git gui does, known as interactive staging (git add -i). Is it much difficult to implement something as the Visual Studio Merge, with checkboxes to select the modifications to stage?

Could not load type GitScc.GitSccOptions from assembly GitApi2

Everything up to date.
Disabling this extension will fix the problem.

Visual Studio ActivityLog.xml:
<entry> <record>3066</record> <time>2019/12/31 11:42:44.879</time> <type>Error</type> <source>VisualStudio</source> <description>SetSite failed for package [MyPackage]Source: &apos;VSIXProject2019&apos; Description: Could not load type &apos;GitScc.GitSccOptions&apos; from assembly &apos;GitApi2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&apos;.&#x000D;&#x000A;System.TypeLoadException: Could not load type &apos;GitScc.GitSccOptions&apos; from assembly &apos;GitApi2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&apos;.&#x000D;&#x000A; at VSIXProject2019.MyPackage.&lt;InitializeAsync&gt;d__3.MoveNext()&#x000D;&#x000A; at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&amp; stateMachine)&#x000D;&#x000A; at VSIXProject2019.MyPackage.InitializeAsync(CancellationToken cancellationToken, IProgress 1 progress)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.AsyncPackage.&lt;&gt;c__DisplayClass20_0.&lt;&lt;Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize&gt;b__1&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at Microsoft.VisualStudio.Threading.JoinableTask.&lt;JoinAsync&gt;d__68.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&#x000D;&#x000A; at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)&#x000D;&#x000A; at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)&#x000D;&#x000A; at Microsoft.VisualStudio.Services.VsTask.GetResult()</description> <guid>{9C86573C-CB62-45D0-9C1A-DAD967BBBDC4}</guid> <hr>80131522</hr> <errorinfo></errorinfo> </entry>

Let me know when is this bug fixed.
Let me know when you need more info.
;-)

How can i call git consle window out?

Hi,

Excellent plugin for git users those who using Vs at the same time , I must say !
I installed version 1.4 with VS2013, and I failed to find the way to trigger Git Console function, which was described in the demo page.
By the way, I found only 3 items above the GITTOOlS menu:

  • Git Changes
  • Git Bash
  • About

Any help?

Add command GitTools.Changes

There is no corresponding command for menu item GitTools/Changes. So it is not possible to assign hotkey for it or invoke it from command window.

Main menu hotkeys

It would be great to add underlined letters (don't know how they called correctly) for main menu items. So that it will be possible to invoke menu item using Alt + letter + letter + ... hotkeys (as it is possible for the rest of the VS main menu).

Git Tools + Resharper causes VS to freeze every few seconds.

I submitted a support request to Jetbrains saying that VS 2013 and 2015 were freezing every few seconds. They analysed the profiling snapshot I sent them and replied:

All the time in the snapshot is taken by git integration into Visual Studio
- F1SYS.VsGitToolsPackage.VsGitToolsService.timer_Tick()
- Microsoft.TeamFoundation.Git.CoreServices.QueuedActionLimiter.DeliverAction()
There's no ReSharper code running in the snapshot.

I don't use the MS Git Provider - I only ever use Git Tools. This problem didn't occur with the old version (when it was called Git Source Control Provider).
I wish I had time to debug this myself but unfortunately I don't. Hopefully some other kind soul can solve this show stopper - it makes VS unusable .

Bring back dragon.exe

Please bring back the visual commit history from the Git Tools for Git Tools 2019

VS 2015 gets very slow after a short period of time

My setup:
Core i7 4710mq CPU, 16GB of RAM, SSD disk.
Fresh copy of Visual Studio 2015, working on a solution with 87 C# projects.

The same issue was also present in the 2013 version.

The old plug-in "Git Source Control Provider" worked fine.
(Unfortunately not available for VS2015)

Add prepare-commit-msg hook support

I use this plugin to add git feature to VS 2015 entreprise, such as commit-msg hook wich validate my commit message and display an error if my rule is not respected.
Is it possible to have the same behavior with the prepare-commit-msg ?
For example with this hook :

#!/bin/sh
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit
  echo '<type>(<component>): <subject>' > .prepare-commit-msg-temp
  echo '' >> .prepare-commit-msg-temp
  echo '<body>' >> .prepare-commit-msg-temp
  echo '' >> .prepare-commit-msg-temp
  echo '# types: feat, fix, docs, style, refactor, test, chore(mantain)' >> .prepare-commit-msg-temp
  { cat .prepare-commit-msg-temp; cat $1; } > .prepare-commit-msg-temp2
  cat .prepare-commit-msg-temp2 > $1
  rm .prepare-commit-msg-temp .prepare-commit-msg-temp2
fi

the comments text area in the commit tab will be filled with :

<type>(<component>): <subject>

<body>

# types: feat, fix, docs, style, refactor, test, chore(mantain)

Can't see "Git changes" window anymore

After Visual Studio update and some extension installations I don't see the "Git changes" window anymore. I think it is related with some (user) settings but I don't remember which entries I have to delete that it works again.

Has somebody a hint?

GitTools for VS2019, Git Changes window not refreshing

Working with GitTools in VS 2017 seems to work fine, but for VS 2019 the "Git Changes" window only seems to work until the first commit. Clicking the "Refresh" button after that point shows the files that were recently checked in, not the active changes in the working directory since the commit.

There doesn't seem to be any remedy for this except to close the solution and reopen it, then it will show the correct changes to the working directory until the next commit, then back to the problem again not showing the changes to the working directory until the solution is closed and reopened.

Margin feature is missing

Any plan to reintroduce margin feature like "Git Source Control Provider"?

Get that feature inside the editor is a valuable bonus.

Thank you for your excelent job.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.