Earlier quoted context omitted.
This creates a new commit that reverses the changes of a past commit. That’s different from undoing your last commit, as in, you made a commit but then changed your mind, and want, say to make some more changes before you commit. (Explained in man git-revert.)
> Explained in man git-revert If git at least had good man pages. The man-page's description is "Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them." [1] I have a hard time parsing that to mean what it's supposed to mean. It contains a note that's much better at explaining what git revert does, then goes on to explain alternatives fo…
Magit, the magical Git interface (2017)
341–350 of 357 posts
Re: Magit, the magical Git interface (2017)
#342I was pretty skeptical about magit at first because I know all the basic git commands for my daily workflows by heart and I don't find them to be very difficult or slow to use. But since I am also an Emacs user and everybody kept telling me to try it out I finally forced myself to use it. And I must say it is very easy to pickup and use productively. It is way better than most of the git integration features you get…
git, as a classic unix cli app, doesn't provide autocompletion
git, as a classic unix cli app, doesn't know nothing about the result of a previous command, etc.
These aren't the git flaws, but Unix ones.
Re: Magit, the magical Git interface (2017)
#343Earlier quoted context omitted.
> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…
There is nothing wrong with using git commands in the terminal. There is also nothing wrong with copying your entire tree to a different directory, diffing, applying patches by hand, and keeping track of what goes where. Those are different levels of automation for the same fundamental task, but they are all legitimate solutions to the same problem, although you might end up spending more or less time to perform the…
What? There is plenty wrong with that. I've worked with people who did that. There are lots of problems with this approach. It's extremely hard to work with and it only gets harder the more people are involved. At least in git the commits have unique identifiers, everything is hashed and checksummed automatically, branches are properly tracked, etc.
I've even worked with non-programmers whose version control was emailing each other files named like:
Presentation final final REALLY FINAL (2) (3).ppt
It was a hell unlike anything else I had ever experienced before.Re: Magit, the magical Git interface (2017)
#344I've never seen the upside. I use Emacs as my primary editor, and I regret it every time I say "today is the day I start using Magit". It is exceedingly invasive, triggering itself even when you don't ask for it (like running "git rebase -i" on the command line). The invasive stuff changes how the text editing itself works, but doesn't add deep features. In the interactive rebase case, I lose the ability to treat the…
Just to clarify, does emacs/magit really pop up when you run "git rebase -i" on the command line? I haven't experienced this, but maybe that's because my EDITOR env var is set to "vim". I would find that very annoying. I like magit, but I never figured out the rebase flow with it, so I just do that on the command line. Where magit really shines for me is being able to stage and unstage hunks of code very easily. Look…
Re: Magit, the magical Git interface (2017)
#345Between using Magit and org-mode, I don't know how I could ever transition away from using emacs. I've tried to resist it, I've sworn it off and moved to exclusively using vim + command line tools for several years, and yet I keep coming back. The degree of integration between these tools is making my workflow more and more seamless over time. emacsclient has made working from multiple terminals a breeze; I don't eve…
Re: Magit, the magical Git interface (2017)
#346Earlier quoted context omitted.
It's also very wise to make sure you disallow force pushing to master/main/production. If you force push to a topic branch, it's usually ok. If you accidentally overwrite someone's changes, it's because you are working together and you can communicate that you messed up and for them to `pull --rebase` or however you want to resolve it. Usually that is. There's always room for disaster :)
--force-with-lease Which BTW I learned it exists when magit switched "p -f u" to use it instead of plain --force.
Re: Magit, the magical Git interface (2017)
#347Earlier quoted context omitted.
It's also very wise to make sure you disallow force pushing to master/main/production. If you force push to a topic branch, it's usually ok. If you accidentally overwrite someone's changes, it's because you are working together and you can communicate that you messed up and for them to `pull --rebase` or however you want to resolve it. Usually that is. There's always room for disaster :)
> Usually that is. There's always room for disaster :) For me, this is where the problem with got lies. I use so many of it's commands infrequently enough that I don't know where the weird disastrous edge cases are, where I should use. I think git would greatly benefit from a topical man page; a list of common and uncommon situations that shows the recommended commands for solving them, and explains what those comman…
Re: Magit, the magical Git interface (2017)
#348Earlier quoted context omitted.
Why would I use magit over the git CLI? 1. Discoverability. It'll display the contextually relevant options and commands at most points. By using magit, you're learning the git CLI commands at the same time, including commands that you'd normally never come across without a comprehensive read of the manual or release notes. 2. Fewer keypresses. Also, extra shortcuts for some common operations. 3. The bits that CLIs a…
I think (2) is why I use it, it's just much faster. It doesn't let you skip over understanding Git, it just makes you work faster. I also think that the experiences of: * looking into a stash and applying only selected changes from it, * browsing all your changes and staging only some of them, * quickly killing changes that you simply want to drop, e.g. not commit and remove from your edits are much slower when using…
Re: Magit, the magical Git interface (2017)
#349Earlier quoted context omitted.
> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…
If you know git cli very well, most of the stuff are straight forward. Most people struggle with git if they have not spent the time to understand how it works. But there is one thing I believe is still not-very-smooth in the git cli: splitting hunks. if I do interactive add in git, and I get small hunk that adds a line, deletes a line, adds another line, and deletes a line, then if I want to include only the additio…
Re: Magit, the magical Git interface (2017)
#350For the sake of discussion, can we get some contrarian views? I'm using magit, along with tig, plain git and sometimes (!) even plain "vc", depending on context. I'm in the camp that thinks it's ok and it's pretty comfortable to use within emacs, but I don't see the earth shattering praise I see every time it's mentioned here. Tig for example is so much faster for history and blame perusal that I find it faster to ke…