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

PullRequest "squash and merge" issue #9540

Closed
2 of 7 tasks
MarcelHillmann opened this issue Dec 29, 2019 · 6 comments
Closed
2 of 7 tasks

PullRequest "squash and merge" issue #9540

MarcelHillmann opened this issue Dec 29, 2019 · 6 comments

Comments

@MarcelHillmann
Copy link
Contributor

MarcelHillmann commented Dec 29, 2019

Description

  1. I pushed some commits to develop
  2. then a PR to master, and accept with "sqash and merge"
  3. no adding an additonal commit to develop
  4. again a PR to master, and the hole proccess is broken
    there are a bounch of merge conflict

Screenshots

image

@davidsvantesson
Copy link
Contributor

davidsvantesson commented Dec 29, 2019

Your HEAD is pointing at branch develop. Did you change the default branch? Other than that I don't find anything strange in your repository and what you describe.
The merge conflict is not strange, you squash merged your changes and then applied new changes directly adjecent to previous changes. Git will give merge conflicts for this diff.
In general, and specifically if squash merge is used, it is a good practice to delete the PR branch after it has been merged.

You can look at your commit graph here:
https://try.gitea.io/MarcelHillmann/testSquashAndMerge/graph
Try to do a git diff between master and develop. I expect it will give a merge conflict, and hence Gitea will too.

@MarcelHillmann
Copy link
Contributor Author

Hi davidsvantesson,

OK, that maks sence.
How can I fix the merge conflict via Gitea?

At moment all following PR are conflicted, and I didn't know an solution to solve the merge conflict.

Thanks
Marcel

@davidsvantesson
Copy link
Contributor

The normal workflow is to delete the branch after it has been merged and create a new branch for new changes. For squash merge this is more important because the merge will not create a reference to your branch (it is not really a merge, rather a "squash and apply").

If you already have changes on top of your merged branches, I would recommend to create a new branch on top of master, then cherry pick the range of new commits after the merge.
https://stackoverflow.com/a/1994491

@6543
Copy link
Member

6543 commented Jan 7, 2020

@MarcelHillmann i think you mean this feature #9014 ?

@davidsvantesson
Copy link
Contributor

davidsvantesson commented Jan 7, 2020

I don't think you want to solve this merge conflict in the UI.
You can try git merge -X theirs master, but I don't think that is the recommended way.

@MarcelHillmann
Copy link
Contributor Author

Hi 6543,

yea, that is a goo solution.

@davidsvantesson

Thanks for you advice.

Thanks
Marcel

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants