我在我的iMac上设置了一个git仓库,现在我想将它下载到我的MacBook上,以便我可以在那里继续工作。我该怎么做呢?
你可以像克隆任何git仓库一样使用git clone
命令。如果你已经设置了git-daemon,则是:
git clone git://your-imac/repoName
git clone username@your-imac:/path/to/your/repo
如果可以访问,就直接使用:
git clone
Git是自包含的 - 只需复制存储库的内容即可正常工作。
如果您可以访问当前机器的SSH,则还可以简单地使用git clone
。
打开终端。
输入cd命令,将文件夹拖放到终端中。
您将进入要下载的同一文件夹。
使用以下命令:
cd <本地机器文件夹路径>
git clone <URL>
例如:Mac-mini: macuser$ cd /Users/macuser/Desktop/GIT_PROJ
Mac-mini:GIT_PROJ macuser$ git clone https://abcd@bitbucket.org/abcd/sample.git
它将把仓库下载到您的本地机器上。
git remote add macbook username@macbook:/path/to/repo
,然后执行fetch
、merge
等命令。 - ndim