开发者

Have Project Part of Two Git Repositories?

Consider the following scenario:

Someone has a project on Github that might be updated once a month, and it has X functionality. I want to take that project and modify it slightly so it开发者_运维问答 no longer functions like X but functions like Y, but I still want to stay up to date with their changes. How do I do this? I'm familiar with merging two projects, but it seems like I need two git repos.

Can I just have the project with two .git directories, one for theirs, one for mine? I don't want to just start a completely new project and not be able to stay up-to-date with their changes, and it's not really practical to make it so their project has the functionality of both X and Y, so it seems best to have merge my project with theirs as a new git repository.

What do you think?


What I think of is branching. Just create a fork ( using clone ) of "their" project and create a branch for your feature y. Then, over time, you can easily merge the original tree back into your branch. Git is very good at this special task. If you want to learn about it, just visit the according chapter in the git-book.

On the other hand, them being located at github invites you to support the development, as maybe other people may also enjoy having "feature y" at their disposition :-)


Fork their repository (on github, for example), make a local clone, then add their repository as a remote with git add-remote. Then you can pull from them and push to your own repository.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜