4 ms·
git didn't really click for me until I learned about patch[0] and had to use it some. I'm not sure if this is entirely correct, but I started thinking of a git
by goatmobile 4y ago
git didn't really click for me until I learned about patch[0] and had to use it some. I'm not sure if this is entirely correct, but I started thinking of a git repository as a DAG[1] of commits, where each commit is a patch (the changed lines of code) along with some metadata like a message, date, etc. Branches fall out of this as they're just names for specific nodes in the DAG, and thing like rebasing is taking a set of nodes (e.g. commits/patches) and replaying them on top of some other base. This has at least helped me get a grasp on how to get out of various situations.
That all said the best way to learn is to do! Maybe see if there is some bug that came up recently but was working in the past, where 'git bisect' would be a good tool to help you debug. And if the GUI tools work for you on a day-to-day basis, there's nothing wrong sticking with them over the command line. To me developer tools are a second-order thing, you should only use them as much as necessary to help you do your actual work.
[0] https://man7.org/linux/man-pages/man1/patch.1.html https://man7.org/linux/man-pages/man1/patch.1.html
[1] https://en.wikipedia.org/wiki/Directed_acyclic_graph https://en.wikipedia.org/wiki/Directed_acyclic_graph