git 存储库到暂存站点到实时站点

发布于 2024-12-27 12:19:05 字数 903 浏览 3 评论 0原文

我正在学习 git 及其基本原理。我有一个正在运行的 Magento 商店,需要尽快对其进行版本控制。我已经在我的工作机器上加载了 git,并尝试了设置存储库、添加、提交和推送文件。我已经使用 Assembla 和免费帐户(目前)测试了我的设置,一切都很好。

不过,我在身体变化方面仍然遇到困难。我想实现以下目标(我认为!):

  1. 从现场站点签出需要在本地计算机上使用的文件
  2. 在 Dreamweaver 中进行本地更改(我正在使用 GITweaver 并且可以轻松地与我的存储库进行通信)(另外,我不是如果有更好的解决方案,则反对更改文本编辑器/IDE)
  3. 将存储库推送到“暂存”站点以供审核和使用和我的伙伴一起测试。这就是我目前迷失的地方。将存储库发送到实时站点的过程是什么?
  4. 接受审核和更改后,将存储库推送到“实时”站点。

所以这里有几个重要的问题需要帮助。

  • 您从实时站点还是暂存站点检出文件?有什么首选方法吗?
  • 舞台网站是否应该始终反映实时网站?
  • “开发”网站和“阶段”网站的目的是什么 - 它们不是相同的吗?
  • 大多数人在这些设置中会做什么?为什么?我需要对阶段与开发进行良好的解释。

对我们的商店/项目有一些有用的背景:

  • 我是唯一的开发人员,并且在一段时间内我可能仍将是唯一的开发人员
  • 我使用 Windows 计算机进行开发,我们的托管是通过 HostGator
  • 我的合作伙伴只需要查看舞台站点这样我们就可以一起查看更改,他不需要查看存储库。

如果有人能为像我这样的人指出指导教程或类似的教程,我会很高兴,因为我以前所有的事情都是倒着做的,现在没有时间一步一步地学习 git。

I'm just learning git and its basic fundamentals. I've got a live Magento store running and need to version control it asap. I've got git loaded on my work machine and have played around with setting up repositories, adding, committing and pushing files. I've tested my setup with Assembla and a free account (for now) and all is good.

I am still having trouble going about the physical changes though. I want to achieve the following (I think!):

  1. Checkout files needed from live site to work with on local machine
  2. Do changes locally from within Dreamweaver (I am using GITweaver and have that easily communicating with my repo) (Also, I am not opposed to changing text editors/IDE's if there is a better solution)
  3. Push repo to 'staging' site for review & testing with my partner. This is where I'm currently lost. What's the process of sending a repo to a live site?
  4. After review and changes are accepted, push repo to 'live' site.

So there's several important questions I need help with here.

  • Do you checkout files from a live site or a stage site? Is there any preferred method?
  • Is a stage site supposed to mirror a live site all the time?
  • What is the purpose of a 'dev' site and a 'stage' site - aren't they the same?
  • What do most people do in there setups and why? I need a good explanation of stage vs dev.

Some helpful background for our store/project:

  • I am the only developer and I will probably remain the only developer for some time
  • I am using a Windows machine to develop on and our hosting is through HostGator
  • My partner will only need to see the stage site so we can look at changes together, he has no need to view the repository ever.

I would be thrilled if someone could point out a guided tutorial or similar for people like me who did everything backwards and now don't have the time to learn git one step at a time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

殤城〤 2025-01-03 12:19:05

将存储库发送到实时站点的过程是什么?

Git 没有内置的工具。您需要编写一个脚本,定期(例如每五分钟)或按需从中央存储库中提取一些分支。 (我假设您在某处有一个具有此类功能的 Git 服务器。)

您可以对生产环境执行相同的操作,方法是让登台服务器拉取(例如 master),并让生产环境服务器拉取分支生产

What's the process of sending a repo to a live site?

Git does not have a facility for this built in. You'll want to write a script that periodically (say, every five minutes) or on demand pulls some branch from your central repo. (I'm assuming you have a Git server somewhere that functions as such.)

You can do the same thing for the production environment, by having the staging server pull, say, master, and having the production server pull the branch production.

木森分化 2025-01-03 12:19:05

@larsmans 为你提供了一些非常可靠的建议 - 我想我会涵盖你的其他观点来尝试帮助你。

将您的dev 服务器视为您(可能还有其他开发人员)进行、测试和完成更改的地方。将阶段服务器视为在其他利益相关者进入生产或实时站点之前向他们展示潜在更改的地方。

我个人为每个服务器使用一个分支(我们甚至在本地计算机进入 dev/staging 之前将本地计算机指定为 alpha 服务器),并且认为其中按层次结构:

  1. prod
  2. stage
  3. dev
  4. alpha

更改从 alpha 开始并向上合并 - 因此从 alpha 开始的错误修复被合并或樱桃挑选> 进入dev,检查,然后向上推送到 stage 并最终推送到 prod。要更新,只需拉动分支并以这种方式同步。每台服务器都有一个存储库的副本,在出现任何问题时提供额外的冗余。

我们有自己的使用 gitolite 的 git 存储库,我们(轻松)定制了它来处理 @larsman 的答案中描述的 pushpull 职责- 不幸的是,由于您位于共享主机上,这可能不是您的理想解决方案。无论哪种方式,您都应该考虑运行 VPS,因为 Magento 非常消耗资源,并且加载时间会受到很大影响 - 这是尝试让 Magento 在 HostGator 上运行的人的第一手建议。

@larsmans has some pretty solid advice for you - I figured I'd cover your other points to try to help you out.

Think of your dev server as where you (and possibly other developers) make, test, and finalize changes. Think of the stage server as where you show potential changes to other stakeholders before they go to the production or live site.

I personally use a branch for each server (we even specify local machines as alpha servers before they even go to dev/staging), and think of them hierarchically:

  1. prod
  2. stage
  3. dev
  4. alpha

Changes start in alpha and are merged upwards - so a bugfix that starts in alpha is merged or cherry-picked into dev, checked, then pushed upwards to stage and ultimately to prod. To update, the branches are just pulled and synced that way. Each server has a copy of the repo, giving extra redundancy in the case of any issues.

We have our own git repository using gitolite, which we've (easily) customized to handle the push and pull duties described in @larsman's answers - unfortunately, since you're on a shared host, this might not be the ideal solution for you. Either way, you should consider running a VPS, as Magento is very resource-intensive and load times suffer greatly - this is first hand advice from someone who has tried to make Magento work on HostGator.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文