Problems merging code in Gitlab from Rider
Hello all,
I have a problem with version control and Rider. We are using Gitlab and my Rider is also connected to it. Push and pull work without any problems. However, as soon as I merge code I get the following error:
21:14:48.676: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- Sprint-0-Project/Sprint-0-Project/Program.cs
21:14:48.764: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false commit -F C:<PATH>git-commit-msg-.txt --
[main 36a7c77] booze
1 file changed, 1 insertion(+), 1 deletion(-)
21:14:51.393: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/main:main
error: failed to push some refs to 'https://<ADDRESS>.git'
hint: Updates were rejected because the remote contains work that you do
To https://<ADDRESS>.git
hint: not have locally. This is usually caused by another repository pushing
! refs/heads/main:refs/heads/main [rejected] (fetch first)
hint: to the same ref. You may want to first integrate the remote changes
Done
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
21:14:54.175: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false fetch origin --recurse-submodules=no --progress --prune
remote: Enumerating objects: 9, done.
remote: Counting objects: 11% (1/9)
remote: Counting objects: 22% (2/9)
remote: Counting objects: 33% (3/9)
remote: Counting objects: 44% (4/9)
remote: Counting objects: 55% (5/9)
remote: Counting objects: 66% (6/9)
remote: Counting objects: 77% (7/9)
remote: Counting objects: 88% (8/9)
remote: Counting objects: 100% (9/9)
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 20% (1/5)
remote: Compressing objects: 40% (2/5)
remote: Compressing objects: 60% (3/5)
remote: Compressing objects: 80% (4/5)
remote: Compressing objects: 100% (5/5)
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
From https://<ADDRESS>
7ccdc29..0ac8de4 main -> origin/main
21:14:56.294: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false merge origin/main --no-stat -v
21:15:06.626: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f --sparse -- Sprint-0-Project/Sprint-0-Project/Program.cs
21:15:06.875: [..\..\sprint-0] git -c core.quotepath=false -c log.showSignature=false commit -F C:<PATH>.git\MERGE_MSG --
[main 0ed43c5] Merge remote-tracking branch 'origin/main'.
I have the problem on two different systems (Linux and Windows). Visualstudio Code 2019 has no problem when merging. It is probably a setting error on my part, unfortunately I can't find it. Help would be very welcome. Thanks in advance!
Translated with www.DeepL.com/Translator (free version)
Please sign in to leave a comment.
From what I can see the only error is:
The process logged seems to be a commit followed by a push, a fetch and a local merge. Did you tried to push afterwards again?
The push failed because there were changes on the remote (a new commit) that were unknown to the local repository. This basically leaves you with two options: (1) overwrite the remote (force push) and loosing the changes or (2) integrate the remote changes. The log seems to do a fetch and a merge of the new commit. Both successfully. But after that there is no push that I can see.
In Rider you have options to control the behavior on a rejection you can read about the options here: https://www.jetbrains.com/help/rider/Commit_and_push_changes.html#update-your-working-copy-if-push-is-rejected
I can't tell from the documentation whether a push should be performed automatically after the update, but personally I'd prefer to do some testing before pushing when remote changes are integrated anyways
Hello,
by default, Rider shows Push Rejected dialogue when pushing to a remote repo from an outdated local copy.
You can configure default behavior in this scenario by navigating to Rider Settings | Version Control | Git | Push.
If you choose to merge changes from this dialogue, the push will happen automatically after the merge succeeds.