在 Mac 上更改 Git 存储库下载路径

发布于 2024-09-25 21:11:45 字数 320 浏览 2 评论 0原文


我经常从 Mac 上的终端使用 git 下载一些存储库,然后使用它。

当我使用这个命令时:

git clone git://git repository URL
repositories are downloaded in my Start folder (name account folder e.g. Matthew, if the name of my Mac account is Matthew).

我想更改下载存储库的文件夹。
下载新的存储库时如何执行此操作?

谢谢,
马修

I often use git from Terminal on Mac to download some repositories and then use it.

When I use this command:

git clone git://git repository URL

repositories are downloaded in my Start folder (name account folder e.g. Matthew, if the name of my Mac account is Matthew).

I'd like to change this folder where repositories are downloaded.
How can I do this when I download a new repo?

Thanks,
Matthew

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

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

发布评论

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

评论(1

匿名。 2024-10-02 21:11:45

Git 将克隆的存储库放置在您当前所在路径中新创建的目录中(使用 pwd 检查)。如果您 cd 到不同的路径,该目录将放置在那里。

或者,您可以指定一个目录作为 git clone 命令的一部分。例如:

git clone git://<git repo url> /path/to/cloned/repo

请参阅git help clone

Git places the cloned repository in a newly created directory in the path you are currently residing (check with pwd). If you cd to a different path, the directory will be placed there.

Alternatively, you can specify a directory as part of the git clone command. For example:

git clone git://<git repo url> /path/to/cloned/repo

See git help clone.

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