News for hackers. Stuff that matters.
Re:Using Emacs and Git with Magit 2.1 by mannimow on Sunday July 12, 2015 @10:16AM (#9873556)
Magit is so good, I nearly forgot how to use git commands anymore.

Navigation is intuitive, diffs are great, discarding and commiting hunks is superb, and it's snappy. It's really an outstanding interface for git!

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 branchless on Sunday July 12, 2015 @05:42PM (#9875100)
Yes I agree and the mappings are largely one to one. As you say magit-process with $ is great.

Next up to play with: whazzup.

Re:Using Emacs and Git with Magit 2.1 by ams6110 on Sunday July 12, 2015 @04:09PM (#9874758)
Going to give it a try. The git command line is so arcane I can't remember it anyway, so this could only be an improvement.
Re:Using Emacs and Git with Magit 2.1 by branchless on Sunday July 12, 2015 @05:43PM (#9875103)
It won't save you from having to understand git, but it will make life quicker.
Re:Using Emacs and Git with Magit 2.1 by kzar on Sunday July 12, 2015 @02:37PM (#9874405)
For anyone who loves Magit as much as me there's a donations page http://magit.vc/donations.html
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 rurban on Monday July 13, 2015 @08:24AM (#9877664)
Just tried it, it's awesome. It could persuade me. Everything just works naturally.
Re:Using Emacs and Git with Magit 2.1 by duncan_bayne on Sunday July 12, 2015 @05:55PM (#9875135)
I have used many Git UIs over the years, and Magit is the first one that lets me work with greater speed and safety than just using the command line.
Re:Using Emacs and Git with Magit 2.1 by chetanahuja on Sunday July 12, 2015 @09:09PM (#9875798)
Magit is love. Magit is life. If you're an emacs and git user but don't use magit, it's a big, big waste of the powers of emacs.
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 creese on Sunday July 12, 2015 @02:02PM (#9874294)
The following works pretty well.

(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)))

Re:Using Emacs and Git with Magit 2.1 by adamrt on Sunday July 12, 2015 @01:49PM (#9874252)
Try "M-x package-list-packages" to see a list and then find it. If it's not there then your package setup is incorrect.
Re:Using Emacs and Git with Magit 2.1 by jmount on Sunday July 12, 2015 @01:55PM (#9874275)
That did it, thank you.
Re:Using Emacs and Git with Magit 2.1 by gtchessplayer on Sunday July 12, 2015 @10:53PM (#9876109)
M-x package-refresh-contents

do this periodically to get your list updated w/ new packages and the latest releases.

Re:Using Emacs and Git with Magit 2.1 by txru on Sunday July 12, 2015 @08:11PM (#9875604)
Emacs is an awesome tool, but vanilla emacs is only ok.

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.

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 josteink on Sunday July 12, 2015 @04:52PM (#9874925)
> With Magit, at least in my experience, you are more inclined to write better commits.

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.

Re:Using Emacs and Git with Magit 2.1 by PuercoPop on Sunday July 12, 2015 @06:50PM (#9875338)
it is also harder from the CLI to stage granular changes (git add -p helps to a point).
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.

Re:Using Emacs and Git with Magit 2.1 by PuercoPop on Sunday July 12, 2015 @06:46PM (#9875323)
So you didn't read the manual or at least the help for the command you were about to use and blame magit for not doing what you expected?

As with many emacs commands you use C-u if you want to specify the refspec to push to.

Re:Using Emacs and Git with Magit 2.1 by kzar on Monday July 13, 2015 @06:22AM (#9877232)
Or with the new version it's `P o` (Push, other).