Git克隆存储库中的子目录 [英] Git Cloning a Sub-Directory in a Repository

查看:204
本文介绍了Git克隆存储库中的子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚建立了一个 Beanstalk 帐户,并使用git创建了一个存储库。

我的存储库用于存放不同的网站我是

 存储库
- website1
- website2
- website3

这些文件夹包含网站活动文件。所以当我提交任何更改时,我将其设置为自动部署到登台服务器FTP。



所以我有:

  developmentdomain.com/website1/ 
developmentdomain.com/website2/
developmentdomain.com/website3/

然后一旦走好,我可以将它推送到该域的活动服务器。我的问题是......如果一个团队成员得到一个在 website2 上工作的任务,他们可以选择使用内置于Beanstalk的文本编辑器,但是如果他们想克隆这些文件,他们可以克隆只是在该存储库内的website2文件夹吗?



或者我接近这个错误的方式吗?



任何帮助都是值得赞赏的。

解决方案

,为每个网站使用不同的存储库。



如果网站碰巧有共同代码,请将公共代码放入另一个存储库并使用 git子模块在每个网站存储库中。


I just set up a Beanstalk account and created a repository using git.

My repository is being used to hold different websites I am working on, and it will act as the staging server.

Repository
   - website1 
   - website2
   - website3

Inside of those folders are the websites active files. So when I commit any changes, I set it up to automatically deploy to the staging server FTP.

So I have:

developmentdomain.com/website1/
developmentdomain.com/website2/
developmentdomain.com/website3/

And then once it's good to go, I can push it to the live server for that domain. My question is... if a team member gets a task to work on website2, they have the option to work on the text editor built in to Beanstalk, but if they want to clone the files, how can they clone JUST the website2 folder inside that repository?

Or am I approaching this the wrong way?

Any help is appreciated.

解决方案

You are doing it wrong, use different repositories for each website.

If the websites happen to have common code, put the common code into another repository and import it with git submodule in each website repository.

这篇关于Git克隆存储库中的子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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