从克隆存储库更新到我的服务器上的原始存储库

发布于 2024-12-20 02:26:17 字数 722 浏览 2 评论 0原文

我确信我在这里做错了一些非常简单的事情,所以我制作了这些图表,希望有人能帮我弄清楚。基本上,我无法从克隆的存储库中获取任何新文件以显示在服务器上的原始存储库上。

目前,我的生产服务器上安装了 magento。我将其创建为 --bare --shared git 存储库,然后将其克隆到我的本地 mac git。

My setup

我了解如何在克隆存储库中暂存和提交,但我认为这都是本地的,包含提交在 mac 的存储库中,实际上并不接触服务器。

committing inside the local mac

这是出了问题的地方,现在我的本地存储库处于我想要的状态,我是否将其推送到原始存储库?

Pushing from local to server

然后,我假设我将在服务器上暂存并提交更改?

staging and committing on server

最后,我意识到这是一个非常基本的工作流程,但我想掌握这个布局现在,在我让事情变得更复杂之前。

谢谢。

I'm sure there's something very simple I'm doing wrong here, so I made these diagrams in the hope that someone can figure it out for me. Basically, I cannot get any new files from my cloned repo to show up on the original repo on the server.

Currently, I have a magento installation on my production server. I made this a --bare --shared git repository then cloned it to my local mac git.

My setup

I understand how to stage and commit within the clone repository, but I assume this is all local, the commits are contained within the mac's repository and don't actually touch the server.

committing within the local mac

This is where something is going wrong, now that I have my local repo in the state I want it, do I push it to the original repo?

Pushing from local to server

Then, I assume I will stage and commit the changes on the server?

staging and committing on server

Last, I realize this is a very basic workflow, but I'd like to master this layout for now before I make things more complex.

Thank you.

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

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

发布评论

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

评论(1

初雪 2024-12-27 02:26:17

在本地存储库中完成阶段并提交后,您必须推送到服务器:

git push origin master

其中 origin 是您要推送到的远程(克隆时自动设置),master 是您要推送的分支。

请注意,您推送的是提交而不是文件。所以一旦你推动了,你就完成了。您不必在服务器上进行暂存和提交。

After you have stage and committed in your local repo, you have to push to the server:

git push origin master

where origin is the remote you are pushing to ( automatically setup when you clone) and master is the branch you are pushing.

Note that you push commits and not files. So once you have pushed, you are done. You don't have to stage and commit on the server.

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