问题描述
我为客户端X创建了一个rails网站。我现在有一个客户端Y,他希望网站能够完成与客户端X完全相同的功能,但具有不同的外观。
我从clientXcode创建了一个git分支,并将其称为clientYcode。然后,我对视图做了所有更改,使其看起来与众不同,并且lala是具有不同皮肤的同一网站。
现在,我不明白git:我在视图,模型和控制器中对clientXcode做了很多更改;现在我想将这些更改合并到clientYcode中,排除任何视图更改。由于视图,模型和控制器在rails中都有自己的文件夹,我希望能够做到这样的事情:
git合并client_x_code'app / controllers / *','app / models / *'
问题1:Is类似git的可能吗?如果是这样,我该怎么做?
问题2:分支是制作我的项目副本的最佳解决方案吗?
那么我发现了最简单的解决方案,我的问题... git checkout clientYcode
git checkout clientXcodeapp / controllers /
git checkout clientXcodeapp / models /
这就是我想要的!
I've created a rails website for client X. I now have a client, Y, who wants a website that does the exact same thing as client X, but with a different skin.
I made a git branch from clientXcode and called it clientYcode. I then did all the changes to the views to make it look different, and lala, the same website with a different skin.
Now here's what I don't understand about git: I've made many changes to clientXcode in the views, models, and controllers; and now I want to merge those changes into clientYcode, excluding any view changes. Since views, models, and controllers each have their own folder in rails I was hoping to be able to do something like:
git merge client_x_code 'app/controllers/*', 'app/models/*'
QUESTION 1: Is something like that possible with git? If so, how would I do it?
QUESTION 2: Was branching the best solution to make a copy of my project?
Well I found the easiest solution to my problem...
git checkout clientYcode
git checkout clientXcode "app/controllers/"
git checkout clientXcode "app/models/"
And that does what I want!
这篇关于Git仅从特定文件夹合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!