在项目上执行"git clone"之前,我需要执行"git init"吗? [英] Do I need to do 'git init' before doing 'git clone' on a project

查看:136
本文介绍了在项目上执行"git clone"之前,我需要执行"git init"吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照说明在项目上执行git clone.但是,我需要事先在目录中执行init吗?

I'm doing a git clone on a project following the instructions. But, do I need to do an init in the directory beforehand?

推荐答案

git clone基本上是以下各项的组合:

git clone is basically a combination of:

  • git init(创建本地存储库)
  • git remote add(将URL添加到该存储库)
  • git fetch(从该URL提取所有分支到您的本地存储库)
  • git checkout(在工作树中创建主分支的所有文件)
  • git init (create the local repository)
  • git remote add (add the URL to that repository)
  • git fetch (fetch all branches from that URL to your local repository)
  • git checkout (create all the files of the main branch in your working tree)

因此,不,您不必执行git init,因为它已经被git clone完成.

Therefore, no, you don't have to do a git init, because it is already done by git clone.

这篇关于在项目上执行"git clone"之前,我需要执行"git init"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆