是否有任何命令会触发GIT分支的更改?

发布于 2025-02-09 11:23:19 字数 180 浏览 1 评论 0 原文

例如,当我们更改文档 vscode.workspace.ondidchangeTextDocument 时,或从另一个文件转到另一个文件 vscode.window.ondidchangeagectivetexteditor 时。是否有任何命令被触发,或者有任何方法可以弄清楚该分支是否已更改?

For example when we alter a document vscode.workspace.onDidChangeTextDocument gets triggered or when we go from one file to another vscode.window.onDidChangeActiveTextEditor gets triggered. Is there any command that gets triggered or any way to figure out whether the branch has been changed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彼岸花ソ最美的依靠 2025-02-16 11:23:19

参见

该API点特别与您要寻找的内容相关:

export interface RepositoryState {
    readonly HEAD: Branch | undefined;
    readonly refs: Ref[];
    readonly remotes: Remote[];
    readonly submodules: Submodule[];
    readonly rebaseCommit: Commit | undefined;

    readonly mergeChanges: Change[];
    readonly indexChanges: Change[];
    readonly workingTreeChanges: Change[];

    readonly onDidChange: Event<void>;
}

这不是一个完整的答案,但是如果您知道如何完成它,请编辑或创建一个答案。

See the git extension API type definitions file.

This API point in particular looks relevant to what you are looking for:

export interface RepositoryState {
    readonly HEAD: Branch | undefined;
    readonly refs: Ref[];
    readonly remotes: Remote[];
    readonly submodules: Submodule[];
    readonly rebaseCommit: Commit | undefined;

    readonly mergeChanges: Change[];
    readonly indexChanges: Change[];
    readonly workingTreeChanges: Change[];

    readonly onDidChange: Event<void>;
}

This isn't a full answer, but please edit it or create one if you know how to complete it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文