![]() Q or escape goes back a "page" like from viewing the log to go back to the staging area S and u to stage and unstage chunks of text/files/lines ? shows help(and every command pops up a menu with options) magit is simply the finest complete git gui that does most things seamlessly. If you know the bare basics of emacs(like a few file commands and how to exit), magit and vim that is a huge productivity win. ![]() I can firmly say that installing emacs and doom emacs is well worth it solely for the magit interface. ![]() I've actually found this to be a better experience compared to using the -p option. This way, I can stage my changes and still exclude extraneous changes or debug statements I've added to the code. That basically updates the numbers in the line that starts with to account for the changes in the number of added and removed lines introduced by the edit. In addition to what I wrote above using git apply -cached, I can actually edit hunks from within vim and then filter the hunk (with the diff header) through the recountdiff utility that comes with patchutils. > Does any GUI offer `-p` in `git commit` and `git stash`? I literally use it 10s times per day, can't live without it once I started using it. Typing my commit message at the top and filtering it through I can commit from within vim by reading the verbose status output by running: If I want to unstage it, I can press u to restore the hunk I just filtered and then run I can stage hunks by yanking the diff header (excluding the line that starts with and pasting it above the hunk I want to stage and then filtering the hunk through: I actually use git via a TUI (text user interface) by using vim to either read from or write to git commands. I may be in between the GUI and CLI camps. ![]() I never have any ambiguity about what it's going to do. I'm comfortable with terminal commands but it's the terminal with a very nice diff view, clean graphs, easier text editing, etc. Sublime Merge will then run it with the exact args you entered, show you the exact CLI command it used, and will show you the exact output.įor me Sublime Merge is strictly better than a terminal. If you want to make a stash with untracked files for example, you just hit the arrow next to "Stash" and get a dropdown with command line args and descriptions for what they do. It doesn't mess with your tree directly, every action maps to a normal human readable git command. Hover over any button and you get the exact git command it will run. I cannot imagine using git and only being able to push entire files.Īnd for the record, I use Sublime Merge and it does a great job mapping to terminal commands. The entire point of a GUI is you get the behavior of -p and -dry-run in a much richer context! I've never seen a GUI that doesn't let you very easily select specific lines for commits and I honestly wouldn't use one that didn't. If you've never found yourself counting lines - repeatedly, because your last attempt failed - while manually editing a hunk, then I envy you. > If you're a mere mortal like me and you're tired of hearing how powerful git is when in your daily life it's a powerful pain in your ass, lazygit might be for you. Rant time: You've heard it before, git is powerful, but what good is that power when everything is so damn hard to do? Interactive rebasing requires you to edit a goddamn TODO file in your editor? Are you kidding me? To stage part of a file you need to use a command line program to step through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, you have to edit an arcane patch file by hand? Are you KIDDING me?! Sometimes you get asked to stash your changes when switching branches only to realise that after you switch and unstash that there weren't even any conflicts and it would have been fine to just checkout the branch directly? YOU HAVE GOT TO BE KIDDING ME!
0 Comments
Leave a Reply. |