logoalt Hacker News

skydhashtoday at 2:48 AM0 repliesview on HN

> which is "ours" and which is "theirs"

"ours" is always HEAD, usually meaning the state of the working_tree, "theirs" is always the commit that is going to change the working_tree.

When merging, you are taking change from another branch (theirs) to create a new commit on the current branch (ours) that ties the two together. When rebasing interactively, you switch to the new base (ours) and replay the changes of the branch (theirs) according to the edit file.

Etymology matters. The conceptual model of git is simple, but people only focus on the operations. That's like trying to learn algorithm and data structures and focusing on the words "insert", "remove", "find", without trying to learn "list", "stack", "tree",... first.

Instead learn about Git's glossary [0], then how the operations use and modify those concepts.

[0] https://git-scm.com/docs/gitglossary