2012-07-03 69 views
0

我想写一个工具,将自动将代码从一个分支合并到其他分支。这将是一个hubot命令,它将合并适当的分支。我正在寻找的是一种在不本地克隆代码的情况下进行合并的方法。有没有办法做到这一点?我使用github,所以github api也会有所帮助。有没有办法在不克隆的情况下合并两个git分支?

回答

0

我不明白你的要求完全,然而,这些措施我用它来合并其他回购分支,看看是否有帮助

git remote add -f (remote name) /path/or/URL/to/remote 
git merge -s ours --no-commit (remote name)/master 
git read-tree --prefix=foo/bar/ -u (remote name)/master 
git commit -m "Merged (remote name) into subdirectory /foo/bar" 

完蛋了。

+0

我不这么认为。我的问题是关于将分支“a”合并到存储库“x”中的分支“b”而不克隆存储库“x” – Spartan

1

github api让你能够直接在github的repo上进行合并而无需克隆。

请参阅the docs

相关问题