Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help - Getting REJECTED_NONFASTFORWARD error with multiple merge commits in Gitlab CI #823

Open
manishteotiarms opened this issue Sep 25, 2024 · 0 comments

Comments

@manishteotiarms
Copy link

manishteotiarms commented Sep 25, 2024

I'm new to both axion-release-plugin and GitLab CI and facing issue when multiple commits are merged into the main branch.

From what I understand, the REJECTED_NONFASTFORWARD error occurs when trying to push changes to a remote Git repository. This indicates that the remote branch has diverged from the local branch, and Git cannot perform a fast-forward merge.

In our GitLab setup, the merge method is set to Merge commit.

Scenario
When two commits are merged consecutively:

  • The second commit doesn't include changes from the first commit.
  • The first commit correctly increments the tag version.
  • However, the second commit's tag increment fails with the REJECTED_NONFASTFORWARD error.

Here is the release stage (Gitlab pipeline) logs for the second commit:

Starting the release process for 1.2.0-SNAPSHOT...
gradle release command invoked successfully.
> Task :verifyRelease
Skipping uncommitted changes check
Skipping ahead of remote check
Skipping snapshot dependencies check
remote status: REJECTED_NONFASTFORWARD
remote message: 
> Task :release FAILED
Creating tag: v1.2.0
FAILURE: Build failed with an exception.
* What went wrong:

How can I make sure that 2nd commit know about the tag which is being created by the 1st merge commit.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant