简体   繁体   English

从远程创建本地 git 存储库

[英]Creating local git repo from remote

I have a remote git repo hosted in gitlab.我有一个远程 git 存储库托管在 gitlab 中。 It's got a few branches off of it already.它已经有几个分支了。

I am trying to pull down these branches to a local repo to work on them.我正在尝试将这些分支拉到本地仓库来处理它们。 For the life of me I cannot figure out how.对于我的生活,我无法弄清楚如何。

This seems like it should be easy but I cannot find an answer.这似乎应该很容易,但我找不到答案。 Please let me know where I can clarify.请让我知道在哪里可以澄清。

one way is using一种方法是使用

$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY

it downloads all your source code and all of your branches.它会下载您的所有源代码和所有分支。 then you can use那么你可以使用

$ git checkout <existing_branch>

in order to change your current branch.为了更改您当前的分支。 you can find out more information on cloning inside here你可以在这里找到更多关于克隆的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM