UiPath Documentation
studio
2025.10
false
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

Studio 用户指南

向 GIT 添加项目

GIT Init”功能可将当前项目添加到本地 GIT 存储库。通过“团队”选项卡或状态栏访问此命令。

  1. Create or open a project in Studio. Select the Start tab > Team. The Team tab is displayed.
  2. Select the GIT Init button, and then select a path where the repository should be initialized. The location may be the same as the project or the parent folder. The Commit changes window opens.
  3. “修改的文件”部分中显示要添加到 Git 存储库中的项目文件。清除您不希望添加的文件旁边的复选框,或使用“全选”和“取消选择”功能。
  4. Select the Show Unversioned Files box to add unversioned files to the list. Write a Commit Message. Select the Commit button to commit the changes to the local Git repository.

结果

将项目添加到 GIT 时,“项目”面板中的上下文菜单包含 GIT 专属选项。 有关更多信息,请参阅“GIT 的上下文菜单选项”

备注:
  • .local 文件夹包含为项目在本地缓存的数据,不应添加到 GIT。

请使用 .gitignore 文件指定要从 Git 排除的文件和文件夹。当您将项目添加到本地 Git 存储库时,系统会自动生成 .gitignore 文件。您可以选择在“修改文件”部分清除 .gitignore 文件旁边的框,将其从存储库中排除。

默认情况下,.gitignore 文件中的 .local 不会被提交。如果现有 .gitignore 文件中缺少 .local,则会自动添加。

提交并推送到 GIT

  1. From the same Commit Changes window, select the Commit and Push button to commit the changes and push them to the remote repository. This Manage Remotes window is displayed. The window is also available from the status bar.

  2. 在“名称”部分中,添加远程存储库的名称。

  3. 在“URL”部分,添加远程 URL。

结果

The project is committed and pushed to the remote repository. Studio shows the number of unpushed changes in the status bar.

若要对添加的存储库进行修改,只需单击一个条目、更改其名称和 URL,然后单击“更新”按钮。完成后,单击“添加”,然后再单击“保存”。以下消息框将打开。这表示本地存储库未与远程存储库同步。

  • 单击“覆盖远程内容”可将文件的本地版本推送到远程存储库并覆盖其中的文件。
  • 单击“拉取(重定基准)”按钮可拉取远程文件并为本地分支重定基准。
  • 单击“取消”按钮可放弃整个操作。

状态栏中会显示未推送的更改数量以及新添加的文件。单击 docs image 图标,打开“提交更改”窗口,或单击 docs image 图标推送更改。

备注:

如果您在外部编辑器中编辑添加到来源控件的项目中的文件,则仅在您单击“项目”面板中的“刷新” Refresh button in the Project panel 后,更改才会在“项目”面板和状态栏中显示。

更改上次提交

Studio 与 Git 的集成也附带一个“修改提交”选项,可以在执行推送前更改最近一次执行的提交。

  1. Open the context menu for a modified file in the Project panel and select Commit. The Commit Changes window is displayed.

  2. 选择“修改提交”框。显示上次的提交消息以及已提交的文件。要查看当前文件和上次提交之间的更改,请使用“显示更改”选项。

  3. Change the commit message and select the files that you would like to include. Select the Commit and Push or Commit button.

结果

The last commit is updated with the revised message and selected files.

撤消待定更改

Studio 附带一个选项,可以在您提交文件并推送到远程存储库之前,撤消对已加入版本控制的文件作出的更改。

修改了本地存储库中的文件后,单击 GIT 上下文菜单中的“撤消”,以打开“撤消待定更改”窗口。

选中文件旁边的复选框,再单击“撤消”。文件现已还原到更改之前的状态。

备注:

“撤消”不包括版本文件。如果创建新文件后选择“撤消”,则不会从项目中删除文件。添加到项目树后,新文件将一直保留,除非手动删除。

  • 结果
  • 提交并推送到 GIT
  • 结果
  • 更改上次提交
  • 结果
  • 撤消待定更改

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新