1 | # Git integration for Visual Studio Code
|
2 |
|
3 | **Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
|
4 |
|
5 | ## Features
|
6 |
|
7 | See [Git support in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support) to learn about the features of this extension.
|
8 |
|
9 | ## API
|
10 |
|
11 | The Git extension exposes an API, reachable by any other extension.
|
12 |
|
13 | 1. Copy `src/api/git.d.ts` to your extension's sources;
|
14 | 2. Include `git.d.ts` in your extension's compilation.
|
15 | 3. Get a hold of the API with the following snippet:
|
16 |
|
17 | ```ts
|
18 | const gitExtension = vscode.extensions.getExtension<GitExtension>('vscode.git').exports;
|
19 | const git = gitExtension.getAPI(1);
|
20 | ``` |
\ | No newline at end of file |