开发者

Can git merge upstream changes both to a file and a copy within a repository?

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 thi开发者_Python百科s (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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜