C H A N N G

写作的意义,是分享给未来的自己

shell脚本查看分支是否相互merge过

merge_destination_branch=$1

merge_source_branch=$2



merge_base=$(git merge-base origin/$merge_destination_branch origin/$merge_source_branch)

merge_source_current_commit=$(git rev-parse origin/$merge_source_branch)

if [[ $merge_base = $merge_source_current_commit ]]

then

  echo "$merge_source_branch 已经被合并到 $merge_destination_branch "


else

  echo "$merge_source_branch 没有被合并到 $merge_destination_branch "


fi
京ICP备18015771号