I always found Git GUIs, especially the ones built into IDEs, to be more confusing and clunkier than working with Git on a terminal. It often feels like unlearning what one knows about Git, and relearning it the way that specific GUI demands.
Heck, I am going through the aforementioned feeling as I force myself to use Magit on Emacs. It just does not feel intuitive. But I will not give up until I have made an honest and full attempt.
The only sensible Git GUI I ever used is Sublime Merge[0], after a coworker praised it immensely. Even that is reserved for the rarest of the rare times when the changes in the workspace gets unwieldy and unruly. For every other instance: Git CLI on a terminal.
How do you view diffs and merges when you say you don't use git GUIs? External tool or terminal/command line?
I use Jetbrains IDEs and most of my life has been IDE based git interaction. And I honestly love it, easy access to see my diffs, the most common commit, push and stage(or shelve as Jetbrains does it, which is better than visual studio). Hassle free and available beats writing anything to me.
How do you view diffs and merges when you say you don't use git GUIs? External tool or terminal/command line?
Terminal.
I use Jetbrains IDEs and most of my life has been IDE based git interaction. And I honestly love it, easy access to see my diffs, the most common commit, push and stage(or shelve as Jetbrains does it, which is better than visual studio). Hassle free and available beats writing anything to me.
Perhaps, it is a mix of learned behaviour and cognitive fixation, as I started out my development journey predominantly using a terminal, that I cannot fathom Git GUI being hassle free.
Nice to read a different perspective on such a fundamental thing that I take for granted while working. Thank you for sharing it.
I asked about that for diffs, because I can't imagine using a terminal for this job. I don't mean any offense by it just to be clear, it's just not something that works for me. Perhaps I rely more on visual orgnaization. To give some context to that:
The standard way git shows up in a terminal (on Windows) it's diffuclt for me to "orient" myself in the code based on the diff, I prefer side by side diff compared to the split addition/deletion lines. I also like syntax highlighing that default git does not do.
Git in a Jetbrains IDE has the diff for any of my changed files is a single click away. The commit window has overview of changed files, a single click to view and edit a diff, including the normal syntax highlighting and one-click revert for a single change. Jetbrains specifically also avoid some of the bothersome part of pulling or checking out changes, as it doesn't force you to stash changes first.
Dealing with a merge conflict without a GUI also seems exessively hard. How do you do that through a terminal and keep track of things? Especially if it is a really messy conflict?
How do you do that through a terminal and keep track of things? Especially if it is a really messy conflict?
I am not sure how to articulate the answer to this question, as it just feels intuitive. It is how I learned and used it, and it would be akin to describing how I see colours. I am sure I would have found it a pain at the beginning.
In the case of a messy merge conflict, it consumes a lot of time, which I am sure would be the case with GUIs too, but I never found Git on terminal getting in my way in such instances.
I prefer side by side diff compared to the split addition/deletion lines. I also like syntax highlighing that default git does not do.
I can say that I prefer inline diff view, and find split diff views to be jarring. I am sure syntax highlighting can be enabled while viewing diffs on terminal. However, I never bothered enabling it, despite using it in my editors for as long as I can remember.
Jetbrains specifically also avoid some of the bothersome part of pulling or checking out changes, as it doesn't force you to stash changes first.
That sounds risky to me. But as long as it make sense to the user, and it always behaves deterministically, it is fine.
I remember trying out the Git GUI offered by CLion a few years back. I found the interactive way of viewing diffs a chore and time consuming. Perhaps, they have revamped the UX; I remember reading about a UI revamp across JetBrains' lineup a year or so back. If so, I will check it out again.
The stashing isn't as bad as it sounds, it keeps a copy around when swapping branch so even if you fuck it up, it should still be in storage. I think the worst one I had was popping from the shelf and it failed to apply but still got removed... I don't remember why that ended up happening but yeah. Not exactly related to the automatic stashing however. But I tend to more often want to keep changes changing branch than not. I have to use stash/Shelve less often because of it.
I know Jetbrains added a "all in one" diff option about a year ago, but I hate it as large/many files make it horribly slow and awful to navigate compared to just moving through the files one at a time. But the diff view itself good. I know there may be some that disagree, but it allows ignoring whitespace and newlines, which filters out non-important from important changes. For most programming (aka not python) whitespace changes means nothing so it doesn't matter 99% of the time. But it greatly improves going through a diff that had a total "code cleanup/reformat". Which is more often than one would expect in my project.
Ignoring whitespace can simplify diffs, but I prefer to keep it visible to see exactly how the code has changed.
I also try to minimize whitespace changes by relegating formatting adjustments to the final stage of a code check-in, after all approvals. It is even better when the project or team uses Git hooks with a linter and formatter to take away this rote work altogether.
Thank you too for sharing your workflow. It is always interesting to read how everyone approaches the same problem in their own way. :-)
JetBrains has really nice Git integration. Interactive rebaseses and merges are quite pleasant but I'm still dipping into the command line to do stuff occasionally. Most commonly a git reset HEAD~ cause I want to split a commit though I had to dig through the reflog the other day cause I suddenly realized I lost an important branch that ended up being over a hundred commits back.