git 常用操作

合并上游主分支

git remote add upstream https://github.com/Intel-bigdata/OAP.git
git fetch upstream
git checkout  master(branch-0.6-spark-2.4.x)
git merge upstream/master(branch-0.6-spark-2.4.x)
或强制覆盖
git reset --hard upstream/master

报错了

检查状态
# git status
# On branch Cache-Orc
# All conflicts fixed but you are still merging.
#   (use "git commit" to conclude merge)
#
# Changes to be committed:
#
#	modified:   src/main/java/org/apache/parquet/hadoop/MrOapRecordReader.java
#	modified:   src/main/java/org/apache/parquet/hadoop/ParquetFiberDataReader.java
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/DataSourceMeta.scala
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/OptimizedOrcFileFormat.scala
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/filecache/FiberSensor.scala
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/index/BitmapReader.scala
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/index/IndexScanner.scala
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/index/indexPlans.scala
#	modified:   src/main/scala/org/apache/spark/sql/execution/datasources/oap/io/ParquetDataFiberReaderWriter.scala
#	modified:   src/main/scala/org/apache/spark/sql/internal/oap/OapConf.scala
#	modified:   src/main/scala/org/apache/spark/sql/oap/OapRuntime.scala
#	modified:   src/main/scala/org/apache/spark/sql/oap/adapter/SqlConfAdapter.scala
#	modified:   src/test/scala/org/apache/spark/sql/execution/datasources/oap/DataSourceMetaSuite.scala
#	modified:   src/test/scala/org/apache/spark/sql/execution/datasources/oap/OptimizedParquetFilterSuite.scala
#	modified:   src/test/scala/org/apache/spark/sql/execution/datasources/oap/filecache/FiberSensorSuite.scala
#	modified:   src/test/scala/org/apache/spark/sql/execution/datasources/oap/index/BitMapIndexSuite.scala

先提交
# git commit
[Cache-Orc 083d542] Merge remote-tracking branch 'upstream/master' into Cache-Orc
git pull

如果有多个 remote , git pull 有可能失败,
可以按照如下, 指定 源

git pull origin dev/{mmm}
再检查
# git merge upstream/master
Already up-to-date.

merge origin to upstream

先切换到 upstream 上的分支

git checkout  upstream/<upstream-branch>
git merge origin/<origin-branch>
merge upstream and resolve
$ git merge upstream/master
Auto-merging native-sql-engine/cpp/src/benchmarks/CMakeLists.txt
CONFLICT (content): Merge conflict in native-sql-engine/cpp/src/benchmarks/CMakeLists.txt
Auto-merging native-sql-engine/cpp/src/CMakeLists.txt
CONFLICT (content): Merge conflict in native-sql-engine/cpp/src/CMakeLists.txt
Automatic merge failed; fix conflicts and then commit the result.

解决这两个CMakeLists.txt,然后
git add 这两个CMakeLists.txt
git commit

这样即可完成conflict解决

checkout 上游分支

git remote add upstream https://github.com/Intel-bigdata/OAP.git
git fetch upstream
git checkout -b independent-offheapCache upstream/branch-1.0

Force merge

git A分支合并B分支,并强制使用B分支代码

git checkout A
git merge --strategy-option=theirs B
git checkout A
git reset --hard B

git A分支合并B分支,并强制使用A分支代码

git checkout A
git merge --strategy-option=ours B

查看 git 日志

查看指定时间段的日志
# git log --after="2019-1-7"
commit bd67a34aff0efd6e7b83866a7473cba4cbf03513
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Date:   Wed Nov 20 13:54:31 2019 +0800

    Optimize ORC File reading For ORC columnVector cache (#1103)

commit 49714e5c6c4f130d1efb0ef8f78c6f2ab2a989bd
Author: JiaKe <ke.a.jia@intel.com>
Date:   Wed Nov 13 11:37:56 2019 +0800

    change the notify threshold from 0 to the dcpmm wait threshold (#1097)

commit 3236f0959d0a8e8dea491fa99e70e2316cd35120
Author: JiaKe <ke.a.jia@intel.com>
Date:   Wed Nov 13 09:38:55 2019 +0800

    sync fiber cache when the reference count is to 0 and if failed, still keep the origin release code path (#1098)

commit 9a8f415f3350e10124eac3e636a94da64c053a06
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Date:   Fri Oct 25 18:14:36 2019 +0800

    Update Spark-OAP-Integration-Guide.md

git log 寻找某段时间的 Author
# git log --after="2019-1-7" | grep "Author"
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: JiaKe <ke.a.jia@intel.com>
Author: JiaKe <ke.a.jia@intel.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: zhixingheyi-tian <1564481943@qq.com>
Author: shaowenzh <zshaowen@126.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: shaowenzh <zshaowen@126.com>
Author: shaowenzh <zshaowen@126.com>
Author: Greg Lee <lihaowhu@gmail.com>
Author: YangJie <yangjie01@baidu.com>
Author: shaowenzh <zshaowen@126.com>
Author: JiaKe <ke.a.jia@intel.com>
Author: shaowenzh <zshaowen@126.com>
Author: shaowenzh <shaowen.zhang@intel.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: Greg Lee <lihaowhu@gmail.com>
Author: YangJie <yangjie01@baidu.com>
Author: YangJie <yangjie01@baidu.com>
Author: YangJie <yangjie01@baidu.com>
Author: Greg Lee <lihaowhu@gmail.com>
Author: Greg Lee <lihaowhu@gmail.com>
Author: WangGuangxin <wangguangxin.cn@gmail.com>
Author: YangJie <yangjie01@baidu.com>
Author: DuRipeng <453243496@qq.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.com>
Author: YangJie <yangjie01@baidu.com>
Author: YangJie <yangjie01@baidu.com>
Author: zhixingheyi-tian <41657774+zhixingheyi-tian@users.noreply.github.co
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zhixingheyi_tian

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值