git:如何将远程的提交合并到不同的路径? [英] git: how to merge commits from a remote to a different path?

查看:107
本文介绍了git:如何将远程的提交合并到不同的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



foo是一个web应用程序,包含一些文件和直接位于其根目录的目录:

 耙文件
应用程序
...
公共
脚本

我的主要git存储库是一个包含此web应用程序的较大系统。我想从foo中提取提交,但我需要将这些文件驻留在 web dir中。所以他们应该变成 web / app web / public 等。



我不想使用foo作为子模块。我想将foo合并到主存储库中,然后将其除去。

这是您的答案的社区wiki版本如果你想接受它作为答案。






这回答了我的问题:

http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html


I have a git repository with remote foo.

foo is a web app, is contains some files and dirs directly in its root:

Rakefile
app
...
public
script

My main git repository is a larger system which comprises this web app. I want to pull the commits from foo, but I need the files to reside inside the web dir. So they should become web/app, web/public, etc.

I don't want to use foo as a submodule. I want to merge foo into the main repository and then get rid of it.

解决方案

Here's a community-wiki version of your answer if you'd like to accept it as the answer.


This answers my question:

http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html

这篇关于git:如何将远程的提交合并到不同的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆