Clone contents of a GitHub repository (without the folder itself)

前端 未结 6 1262
梦谈多话
梦谈多话 2020-12-04 04:57

I\'d like to git clone the contents of a repository I have on GitHub. When I git clone (git@github:me/name.git...) I get a folder called name

6条回答
  •  醉酒成梦
    2020-12-04 05:36

    If the current directory is empty, you can do that with:

    git clone git@github:me/name.git .
    

    (Note the . at the end to specify the current directory.) Of course, this also creates the .git directory in your current folder, not just the source code from your project.

    This optional [directory] parameter is documented in the git clone manual page, which points out that cloning into an existing directory is only allowed if that directory is empty.

提交回复
热议问题