-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
I'm getting the fatal: refusing to merge unrelated histories when I'm trying to merge branches, for some reason.
My steps:
- name: Use checkout v2
uses: actions/checkout@v2
with:
ref: refs/heads/master
token: ${{ secrets.GITHUB_CI_TOKEN }}
- name: Merge development into master
run: |
echo "# Config"
git config --local user.email "[hidden]"
git config --local user.name "CI"
echo "# Fetch all"
git fetch --all
echo "# Checkout/pull development"
git checkout development
git pull
echo "# Checkout/pull master"
git checkout master
git pull
echo "# Merge"
git merge development -X theirs
echo "# Push"
git push origin mastermaster and development branches can't have unrelated histories, because development was branched from master.
Running those commands locally works as expected.
Update:
Adding --allow-unrelated-histories to the merge command makes it work.
I don't understand how does git detect the branches as having different histories though.
isaiahb, haltcase, adrianbastholm, hexvolt and eugene-ivanenko
Metadata
Metadata
Assignees
Labels
No labels
