Re:Git cherry-pick and revert use 3-way merge
by dboreham on Friday November 10, 2023 @02:35PM
(#38223454)
Also I've always found that cp working-tree broken-tree, then git clone <new-tree> then <manually fix up files I was working on> almost always beats trying to detailed the 10 suggested SO solutions.
[ Parent
| on HN ]
Re:Git cherry-pick and revert use 3-way merge
by Galanwe on Friday November 10, 2023 @02:53PM
(#38223657)
That's basically what I did the first year working with git.
Then I met a coworker that told me to stop doing this and come with him on a whiteboard to understand and solve the problem.
That was painful the first month, but after some months of that treatment I had a strong mental model of exactly what happened, and how to fix it.
I think overall the mental model is to
1) get knowledgeable enough to be able to actually draw the current graph of commits, branches and inheritance
2) clearly lay down the desired structure of the target graph
3) perform the steps necessary to transform the graph from 1) to 2).
Re:Git cherry-pick and revert use 3-way merge
by mbork_pl on Friday November 10, 2023 @03:03PM
(#38223793)
Also, Git has this weird feature called "workdirs" which may help with that, too.
Re:Git cherry-pick and revert use 3-way merge
by coryrc on Friday November 10, 2023 @03:11PM
(#38223891)
http://learngitbranching.js.org
A couple hours and you'll never need to do that again. I promise!
Re:Git cherry-pick and revert use 3-way merge
by samus on Friday November 10, 2023 @04:02PM
(#38224492)
I've always found that a good Git user interface goes a long way to understand what is really going on. The commit graph and the conflict resolution UIs are most important. The right choice is very personal - I've found understanding the contents of a repo purely on the terminal to be torture, even though I issue most commands from there.