Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Cursor Prompt Rules SyncNew to Visual Studio Code? Get it now.
Cursor Prompt Rules Sync

Cursor Prompt Rules Sync

liaochenliang.cursor-prompt-rules-sync

|
5 installs
| (0) | Free
Sync cursor prompt rules and other files from a git repository to the current workspace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cursor Prompt Rules Sync

这个 VSCode 扩展允许您将 Git 仓库中的 Cursor 提示规则和其他文件同步到当前工作区,并提供提交和拉取功能。

功能

  • 仅同步 .cursor 和 .promptx 文件夹,不会影响项目其他文件
  • 自动将 .cursor 和 .promptx 文件夹添加到项目的 .gitignore 中,防止意外提交
  • 将指定 Git 仓库的 Cursor 提示规则同步到当前工作区
  • 提供提交和拉取功能,方便协作
  • 自动处理 .gitignore 文件,确保 Git 项目路径被忽略
  • 支持私有仓库的用户名和密码/令牌认证
  • 安全存储 Git 密码(使用系统密钥链而非明文配置)
  • 提供一键更新 .gitignore 文件功能,自动添加 .vscode、.promptx 和 .cursor 等目录

使用方法

配置 Git 仓库

  1. 按下 Ctrl+Shift+P (Windows/Linux) 或 Cmd+Shift+P (macOS) 打开命令面板
  2. 输入 Cursor Sync: Configure Git Repository 并选择该命令
  3. 按照提示输入 Git 仓库 URL、分支名称和认证信息(如果需要)

同步文件

配置完成后,您可以使用以下命令同步文件:

  • Cursor Sync: Sync Files from Git Repository - 从 Git 仓库同步 .cursor 和 .promptx 文件夹到当前工作区
  • Cursor Sync: Commit Changes to Git Repository - 提交当前工作区中 .cursor 和 .promptx 文件夹的更改到 Git 仓库
  • Cursor Sync: Pull Changes from Git Repository - 从 Git 仓库拉取 .cursor 和 .promptx 文件夹的最新更改

更新 .gitignore 文件

  • Cursor Sync: Update .gitignore File - 创建或更新 .gitignore 文件,自动添加常用忽略项(如 .vscode/、.promptx/ 和 .cursor/)

自动同步

您可以在配置过程中选择是否在 VSCode 启动时自动同步文件。

扩展设置

此扩展提供以下设置:

  • gitSync.repositoryUrl: Git 仓库 URL
  • gitSync.branch: 要同步的分支(默认为 main)
  • gitSync.syncOnStartup: 是否在 VSCode 启动时自动同步文件
  • gitSync.username: Git 用户名(可选)

安全性

  • Git 密码不再存储在 VSCode 配置中,而是使用系统的安全密钥链存储
  • 这确保了您的密码不会以明文形式出现在配置文件中
  • 支持 Windows Credential Manager、macOS Keychain 和 Linux Secret Service

注意事项

  • 首次使用时,请先配置 Git 仓库
  • 确保您有足够的权限访问目标 Git 仓库
  • 如果您的工作区已经是一个 Git 仓库,扩展会自动将同步的仓库路径添加到 .gitignore 文件中
  • 此扩展仅同步 .cursor 和 .promptx 文件夹,不会影响项目中的其他文件
  • 扩展会自动将 .cursor 和 .promptx 文件夹添加到项目的 .gitignore 中,防止这些文件被意外提交到项目仓库中

问题反馈

如果您遇到任何问题或有改进建议,请在 GitHub 仓库中提交 issue。

许可证

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft