Effective June 17, 2024, Cloud Source Repositories isn't available to new customers. If your organization hasn't previously used Cloud Source Repositories, you can't enable the API or use Cloud Source Repositories. New projects not connected to an organization can't enable the Cloud Source Repositories API. Organizations that have used Cloud Source Repositories prior to June 17, 2024 are not affected by this change.
发送反馈
在 Cloud Shell 中浏览文件
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本主题描述如何使用 Cloud Shell 浏览文件。
首次在 Cloud Shell 中打开代码库
在 Google Cloud 控制台中,打开 Cloud Source Repositories。
打开 Cloud Source Repositories 。
点击代码库的名称。
此时将会打开一个页面,上面显示代码库的内容。
点击 Edit code 。
此时会打开一个包含 Cloud Shell 环境的新浏览器标签。还会提示您确认是否要将代码库克隆到 Cloud Shell 中。
点击继续 。
此时会打开 Cloud Shell 环境,其中包含克隆的代码库。
默认情况下,代码库的位置为 ~/[repository name]
。例如 ~/hello-world
。
使用 Cloud Shell 打开现有代码库
如果您已将代码库克隆到 Cloud Shell 环境中,请按照上一部分中的步骤操作。准备好 Cloud Shell 环境后,系统会提示您从以下选项之一中进行选择:
导航到该目录。要将目录自动更改为包含您的代码库的目录,请选择此选项。例如 ~/hello-world
。
导航到该目录并运行 git pull
。要将目录自动更改为包含您的代码库的目录,并将最新版本的代码库拉到 Cloud Shell 环境,请选择此选项。
使用 git clone
命令克隆新副本。要在 Cloud Shell 环境中创建一个包含代码库的新文件夹,请选择此选项。新文件夹名称与代码库名称一致,并附加一个数字。例如,代码库的第二个副本 hello-world
的名称为 ~/hello-world-2
。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-10。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-10。"],[],[]]