你如何克服一个Git仓库到一个特定的文件夹? [英] How do you clone a Git repository into a specific folder?

查看:99
本文介绍了你如何克服一个Git仓库到一个特定的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行命令 git clone git@github.com:whatever 在当前文件夹中创建一个名为whatever的目录,并将Git存储库的内容放入该文件夹中:

  / httpdocs / whatever / public 

我的问题是,我需要克隆到当前目录的Git存储库的内容,以便它们出现在Web服务器的正确位置:

  / httpdocs / public 

我知道如何在克隆存储库后移动文件,但这似乎打破了Git,我希望能够通过调用 git pull 来进行更新。

解决方案

选项A:

  git clone git@github.com:任何文件夹名称

选项B:

也移动.git文件夹。



更好:

将您的工作副本保存在其他地方,并创建一个符号链接。


Executing the command git clone git@github.com:whatever creates a directory in my current folder named whatever, and drops the contents of the Git repository into that folder:

/httpdocs/whatever/public

My problem is that I need the contents of the Git repository cloned into my current directory so that they appear in the proper location for the web server:

/httpdocs/public

I know how to move the files after I've cloned the repository, but this seems to break Git, and I'd like to be able to update just by calling git pull. How can I do this?

解决方案

Option A:

git clone git@github.com:whatever folder-name

Option B:

move the .git folder, too.

Better yet:

Keep your working copy somewhere else, and create a symbolic link.

这篇关于你如何克服一个Git仓库到一个特定的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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