Merge two gitlab branches in Jenkins build

Viewed 35

Inside my Jenkins job I would like to merge two gitlab branches together (My Jenkins and GitLab repository are already configured). I have a dev, qa, and main branch in gitlab. I want to build the job and for it to read the files that are different from dev and qa, then automatically merge dev into qa (and keep dev). This is what I have so far in my execute shell build:

test=$(git diff --name-status origin/dev..origin/qa)
echo $test
git checkout dev
git reset --hard qa
git push --force origin qa 

This gives me the following error:

git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
0 Answers
Related