Read current git branch using vscode extension

While I am developing the extension for Visual Studio code (vscode), I asked myself how to read git refs correctly, as the current branch, using my own methods.

My current solutions are more like a workaround:

  • choose git path
  • run git rev-parse', '--abbrev-ref', 'HEAD'
  • returns stdout as a string and is placed in a variable (e.g. master)

Full implemented method here (forked extension gitHistoryVSCode)

Any other ideas like how to access extension methods / git or model properties?

+4
source share

No one has answered this question yet.

See similar questions:

:

15981
Git ?
7919
Git?
6475
() Git
6334
Git?
4540
() Git
4105
Git ?
3946
Git?
3398
Git ?
2990
Git?
2886
Git

Source: https://habr.com/ru/post/1681719/


All Articles