Re:Using Emacs and Git with Magit 2.1
by branchless on Sunday July 12, 2015 @12:18PM
(#9873905)
> I nearly forgot how to use git commands anymore
This is my one fear. I am however willing to put up with this decay given the increase in productivity. It's up there with org-mode as an emacs feature.
Re:Using Emacs and Git with Magit 2.1
by sandinmyjoints on Sunday July 12, 2015 @01:10PM
(#9874103)
After more than two years using Magit, I can only think of one instance when I didn't recall a git command when I needed it. It took about 5s of googling to find.
You can always see what command Magit is running behind the scenes by hitting `$`, in case you're curious -- I've learned a few things this way.
Re:Using Emacs and Git with Magit 2.1
by peterhadlaw on Sunday July 12, 2015 @10:57AM
(#9873663)
I appreciate how Magit isn't something that takes away from the git experience by holding your hands like a GUI might. Magit is just an efficient interface that in the end is just like using standard git in the command line.
Re:Using Emacs and Git with Magit 2.1
by toufka on Monday July 13, 2015 @12:16AM
(#9876355)
As someone coming from a different discipline, git is tricky. Why would you not want to take away from that tricky experience by having a GUI? I understand the power of git, but it's really hard to use coming from a user's perspective, especially if you're working in less command-liney languages. I'd love to have a gui for git!
Re:Using Emacs and Git with Magit 2.1
by rurban on Sunday July 12, 2015 @04:52PM
(#9874924)
I just switched from command-line foo to magit today (export GIT_EDITOR=emacsclient) by accident, and I'm very surprised how much easier it is now to solve complicated rebase scenarios.
I'm a very sceptical emacs user, who prefers the terminal over M-x shell and friends.
Once I got used to the few keys, it is much better than anything else I saw before, and much faster than doing it manually.
Moving picks up or down with one key, killing it, fixup, squash, inspection, ... all with one key.
Re:Using Emacs and Git with Magit 2.1
by adamrt on Sunday July 12, 2015 @06:04PM
(#9875173)
i wanted a terminal in emacs that was as standard as possible and created 'sane-term'. Just ansi-term with a couple useful features. Sorry for the plug
Re:Using Emacs and Git with Magit 2.1
by jmount on Sunday July 12, 2015 @01:35PM
(#9874204)
Anyone able to help me out here? How do you get it to install? I tried the Melpa instructions and added the following to my .emacs:
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
I bounced emacs, it seemed to come back up okay. But (emacs 24.5.1 OSX) when I type "M-x package-install" it claims magit [No Match]
I use emacs- but I don't tend to customize it much.
Re:Using Emacs and Git with Magit 2.1
by wwkeyboard on Sunday July 12, 2015 @11:19AM
(#9873719)
I really live having good formatting and spell check in the commit messages. It's much nicer than the `git commit -m "blah"` messages. Sure I could use another GUI, but magit is very easy when I'm already in emacs.
Re:Using Emacs and Git with Magit 2.1
by branchless on Sunday July 12, 2015 @12:19PM
(#9873910)
If you leave out -m 'blah' git uses your $EDITOR which could be vim/emacs/whatever, which of course can spell check. So that one part is not a selling point for magit.
Re:Using Emacs and Git with Magit 2.1
by tanderson92 on Sunday July 12, 2015 @12:20PM
(#9873913)
Perhaps you do not know, but if you leave off the -m switch, git will launch $EDITOR with a commented list of files changed, where you can write your commit message.
Re:Using Emacs and Git with Magit 2.1
by deltaprotocol on Sunday July 12, 2015 @03:15PM
(#9874548)
Perhaps he did not know, but I find that a lot of developers, especially those not using GUIs, end up using -m every single time and writing poor commit messages. With Magit, at least in my experience, you are more inclined to write better commits.
If you give developers a "lazy" option, a lot will default to it, which isn't ideal. -m is an alternative for a quick commit and end up being front and center when using the CLI.
Re:Using Emacs and Git with Magit 2.1
by iamthebest on Sunday July 12, 2015 @03:04PM
(#9874500)
My experience with Magit:
I played around with it, and didn't see any advantage over using git commands.
Then I tried pushing a change. I was expecting some confirmation on what refspec to use... but no! Magit pushed my change directly to refs/heads instead of refs/for, completely bypassing gerrit code review.
I got burned. That was it; I'm never using Magit again.
Navigation is intuitive, diffs are great, discarding and commiting hunks is superb, and it's snappy. It's really an outstanding interface for git!
This is my one fear. I am however willing to put up with this decay given the increase in productivity. It's up there with org-mode as an emacs feature.
You can always see what command Magit is running behind the scenes by hitting `$`, in case you're curious -- I've learned a few things this way.
Next up to play with: whazzup.
Once I got used to the few keys, it is much better than anything else I saw before, and much faster than doing it manually.
Moving picks up or down with one key, killing it, fixup, squash, inspection, ... all with one key.
I use emacs- but I don't tend to customize it much.
(defvar packages '(pkg1 pkg2 magit))
(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize) (package-refresh-contents)
(dolist (p packages) (when (not (package-installed-p p)) (package-install p)))
do this periodically to get your list updated w/ new packages and the latest releases.
I highly recommend that you take a couple of days or so and try playing around with packages that apply to your use. That's where it really shines.
If you give developers a "lazy" option, a lot will default to it, which isn't ideal. -m is an alternative for a quick commit and end up being front and center when using the CLI.
I have flyspell-mode enabled for git-commit-mode. Avoids embarrassing typos in my git commit log.
It's little stuff like this adding up, making Emacs too great to ever be without.
I played around with it, and didn't see any advantage over using git commands.
Then I tried pushing a change. I was expecting some confirmation on what refspec to use... but no! Magit pushed my change directly to refs/heads instead of refs/for, completely bypassing gerrit code review.
I got burned. That was it; I'm never using Magit again.
As with many emacs commands you use C-u if you want to specify the refspec to push to.