有一个主分支:
https://github.com/OpenTSDB/opentsdb
和下一个分支:
https://github.com/OpenTSDB/opentsdb/tree/next
我需要克隆master,下载下一个分支,合并它们并构建它们:
我试过这个:
git clone https://github.com/OpenTSDB/opentsdb.git --depth=1 -b next
cd opentsdb/
git fetch origin master:master --depth=1
git merge -s ours master
当我尝试构建最终代码时,我收到此错误:
javac: file not found: src/query/TagVFilter.java
Usage: javac <options> <source files>
use -help for a list of possible options
make[1]: *** [.javac-stamp] Error 2
make[1]: Leaving directory `/app/data.3/opentsdb/build'
make: *** [all] Error 2
如何在github中合并master和next分支?
答案 0 :(得分:2)
我建议将分支next
和master
合并到其中,手动解决冲突。
git clone https://github.com/OpenTSDB/opentsdb.git
cd opentsdb
git checkout -b next origin/next
git checkout master
git merge next
现在存在一些冲突,应该是3个文件:NEWS
,configure.ac
,src/core/AggregationIterator.java
。你必须resolve them manually。
AggregationIterator.java
似乎会自动合并。
以下命令
git diff --stat next > diff.txt
给我们:
更改了157个文件,5924个插入(+),22414个删除( - )
因此分支应该可以手动合并。
git log --oneline --graph --decorate master..next > master_next.txt
输出为196行。这意味着next
自分支以来已经在master
之前提交了196次提交。然而,
git log --oneline --graph --decorate next_master > next_master.txt
只有7行:
* 45e575a (HEAD, origin/master, origin/HEAD, master) Improve query performance in the AggregationIterator by calling .hasNext() on the downsampler instead of letting it build a giant exception string that we're just tossing in the bit bucket.
* 248fee6 (tag: v2.1.0) Release version 2.1.0
* bb061c7 Merge branch 'next'
* 7129df4 (origin/maintenance) Remove links to the old Google code repo in the third party includes.
* 791c9e3 Cleanup the Config class a bit. Make sure to close the conig file after opening and add more unit tests.
* 2b5b5f3 Add unit tests for config directory fix Move null check to top of config directory parsing so that it will take care of Windows systems as well
* 11ac8f3 Fixed issue throwing a null exception when a config directory is null.
merge-base of two commits为dcf516f96ed10ce0b95b1e62847fbead723b87e1
。
git diff dcf516f96ed10ce0b95b1e62847fbead723b87e1
NEWS | 16 ++++++++++++++--
configure.ac | 2 +-
src/core/AggregationIterator.java | 9 ++-------
3 files changed, 17 insertions(+), 10 deletions(-)
因此,您只有三个文件在master
中被更改,因为它们的共同祖先是next
。可能是修补程序。你没有什么工作要做。