How To Solve Git Merge Conflicts ?

Asked by Sameer Sharma

Hey there due to lack of documentation, i am unable to understand how do i solve or fix git merge conflicts ?? i tried some tutorials but they dont seem to apply on launchpad scenario, i was unable to find the conflicting branch and file locally while there is a merge conflict being shown in launchpad, also ii anyone could better explain the merge guidelines will be grateful.

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Jürgen Gmach
Solved:
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

There's nothing Launchpad-specific about this. Have you tried just following generic git advice such as https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_merge_conflicts and then pushing the result back to Launchpad?

Revision history for this message
Sameer Sharma (sameersharma2006) said (last edit ):
#2

I didnt see that but i will refer it in the future, the problem in my side is when i enter the command to delete the branch with the specified command it says it doesnt exist and says me to use track and origin/ plus another aspect that i dont understand is whether i have to open merge proposal in launchpad after merging locally or before it, i believe the error i got was due to opening merge proposal before doing it locally ??
Plus my lack of understanding and confusion arises on doing this with remote branches.

Revision history for this message
Colin Watson (cjwatson) said :
#3

Please can you post an exact copied-and-pasted transcript of what you're doing rather than paraphrasing the error messages?

You'd open a merge proposal on Launchpad once you have something that you believe is ready for review. If review comments indicate that you need to fix something, then you can push changes to the same branch and the merge proposal will be updated to reflect that.

Revision history for this message
Sameer Sharma (sameersharma2006) said :
#4

Hey there unfortunately i dont have the logs as i ended up somehow merging though it was surely done in a wrong and unknown way, all i can tell is i used "--allow-unrelated-histories" flag to actually solve this problem combined in total --> (git merge origin/main --allow-unrelated-histories).
I would really love some better friendly docs on git merging handling in launchpad though.
Thanks.

Revision history for this message
Best Jürgen Gmach (jugmac00) said :
#5

Hey Sameer,

I cannot find any documentation about handling merge proposals for git, so I agree, there is something we need to do.

Could you please create a bug report for Launchpad?

As for Launchpad there is no merge-bot by default, after you merge the branch locally on your computer, you need to push the updated branch back to Launchpad. Launchpad will automatically notice that a merge proposal had been merged and mark it as "merged".

So, most of the work is just ordinary git, for which my colleague already provided some information.

Jürgen Gmach
Launchpad team

Revision history for this message
Sameer Sharma (sameersharma2006) said :
#6

Thank you for the clarification, i will create a bug report as suggested.

Revision history for this message
Sameer Sharma (sameersharma2006) said :
#7

Thanks Jürgen Gmach, that solved my question.