Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
What I tend to do:
1. copy off all the commit hashes you've made on your branch you want to merge (git log, or tig)
2. pull down the latest master
3. git cherry-pick all your commits in order. git rebase -i <hash before your first cherry-pick on master>
4. If you have multiple commits that should just be one, squash them into relevant names and features
5. Push your new branch and submit a merge request.
6. Get it merged in.
7. Delete the old working branch -
I'm curious, why not rebase your working branch and keep the conflicts there in the first place?
Also, shouldn't you be already on develop, if you're merging a feature? -
Git merge --abort
Git checkout -b new-branch for squash merge
Git reset --soft {commit hash of the point you deviated from Target branch}
Git commit -m {message}
Git rebase {target branch}
^single commit merge, much easier
And don't use non-fast forward merges, or any mechanism that produces a merge commit; they render git bisect and git revert useless -
anolis3735yThank you for this advice, will be useful in the future,
Was just wondering if it was possible to leave a merge in the middle of fixing conflicts and navigate back to develop -
@anolis
Believe it or not, there's a method for that:
Git rerere (not kidding)
https://git-scm.com/docs/git-rerere
The theory is that rerere will allow you record your merges as you go, then apply them all at once in the final merge.
#GitFu
Related Rants
Git Question:
Semiunusual state here. Have a branch I'm trying to merge into develop and there are a LOT of merge conflicts, some head way has been made in this merge branch..
HOWEVER
I'm wondering is there a way to "suspend" the branch/merge progress and go back to develop?
question
git
mergehell