ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
假设您是其中一位团队成员,把现有的远程数据库克隆到另一个目录( tutorial2 )。 ## Mac 点击SourceTree的书签列表左上方的“Add Repository”按钮。或者,在菜单栏中点击“文件” >“新建”。 ![启动原始码(SourceTree)](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_1_mac.png) 点击“Clone Repository" 按钮,再输入远程数据库的URL和要保存的本地数据库的目录,然后点击“Clone”。 这样就把上一页面中创建的数据库,以“tutorial2”的名称进行了克隆。 ![用目录名称tutorial2克隆](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_2_mac.png) 克隆的数据库已添加到书签列表。 ![已添加到书签列表中](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_3_mac.png) ## Windows 请双击桌面上的任意地方,然后从右击菜单中选择“Git克隆”。 ![点击Git克隆](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_1_win.png) 点击“Clone Repository" 按钮,再输入要克隆的远程数据库的URL和要保存的本地数据库的目录,然后点击“确定”。 这样就把上一页面中创建的数据库,以“tutorial2”的名称进行了克隆。 ![克隆设置](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_2_win.png) 克隆将在以下画面开始进行。完成克隆后请点击“关闭”以退出画面。 ![克隆成功](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_3_win.png) 已创建“tutorial2”目录。 ![新手tutorial2目录已建立](http://backlogtool.com/git-guide/cn/img/post/intro/capture_intro4_3_4_win.png) ## 命令行 使用clone指令可以复制数据库,在`<repository>`指定远程数据库的URL, 在`<directory>`指定新目录的名称。 ~~~ $ git clone <repository> <directory> ~~~ 执行以下指令后,会在目录(tutorial2) 复制远程数据库。 ~~~ $ git clone https://nulab.backlog.jp/git/BLG/tutorial.git tutorial2 Cloning into 'tutorial2'... Username: <用户名> Password: <密码> remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. ~~~ 若要验证克隆是否成功,请看在复制的目录“tutorial2”中的sample.txt是否含有以下文字。 ~~~ 连猴子都懂的Git命令 ~~~