git 能否将上游更改合并到存储库中的文件和副本?
有没有办法在 git 存储库中复制文件(或子目录)并让 git 将上游更改合并到两个副本?
Randal Schwartz 提到 git 可以做到这一点(Google Tech 演讲进行了 27 分钟:http://www .youtube.com/watch?v=8dhZ9BXQgc4 )
背景:我正在使用 git 来跟踪和更新 CMS 软件——即,我在服务器上的 git 存储库中拥有 CMS,并且我提取并合并更新从公开发布分支进入此。问题是我制作了一个自定义主题,它是默认主题目录的副本,并进行了少量修改(即我的存储库中既有默认主题又有自定义主题,并且希望保留两者)。当我更新时,git 会将更改合并到默认主题文件中,但不会合并到我的自定义主题中,因此每次默认主题文件更新时,我都必须在副本中手动进行这些更改。我希望它自动将这些更改与两个副本合并。
Is there a way to copy a file (or subdirectory) within a git repo and have git merge upstream changes to both copies?
Randal Schwartz mentions that git can do this (27 minutes into this Google Tech talk: http://www.youtube.com/watch?v=8dhZ9BXQgc4 )
Background: I'm using git to track and update CMS software---i.e., I have the CMS in a git repo on my server and I pull and merge updates from the public release branch into this. The problem is that I have made a custom theme, which is a copy of the default theme directory with minor modifications (i.e. I have both the default and custom themes in my repo, and want to keep both). When I update, git merges the changes into the default theme files, but not into my custom theme, so every time there is an update to the default theme files, I have to manually make those changes in my copy. I want it to merge those changes automatically with both copies.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我很难完全理解你的问题。无论您需要在生产服务器中执行什么操作,当然都可以进入存储库。据我了解,您拥有带有库存主题文件的核心 CMS 文件,您可以对其进行修改(您不会修改库存主题的副本),并且当有较新版本的 CMS 时,很难重做这些更改,对吧?有没有办法复制库存主题并在副本上工作而不是修改核心主题?这样您就可以将所有内容放入存储库中。
I have trouble fully understanding your question. Whatever you need to do in the production server can of course go inside the repository. From what I understand, you have the core CMS files with the stock theme files, which you modify (you don't modify a copy of the stock theme) and have trouble redoing these changes when there's a newer version of the CMS, right? Isn't there a way to copy the stock theme and work on the copy instead of modifying the core theme? This way you can put everything inside the repository.