Questions tagged [magit]

Magit is an Emacs mode for interacting with Git.

Magit is an interface to the version control system Git, implemented as an Emacs extension.

Unlike the Version Control package which is part of Emacs and strives to provide a unified interface to various version control systems, Magit only supports Git and can therefore better take advantage of its native features.

With Magit, you can inspect and modify your Git repositories with Emacs. You can review and commit the changes you have made to the tracked files, for example, and you can browse the history of past changes. There is support for cherry picking, reverting, merging, rebasing, and other common Git operations.

Magit's maintainer prefers if questions are asked on the dedicated Emacs Stackexchange site instead of here.

168 questions
5
votes
1 answer

Using magit style diffing generally

I enjoy using magit and whenever I have to look at a diff outside of magit, it occurs to me how inferior the default diff experience is. Two aspects in particular: 1) refine diff automatically as I move into new hunks. - diff-auto-refine-mode is…
event_jr
  • 17,467
  • 4
  • 47
  • 62
4
votes
1 answer

magit and /usr/bin/emacsclient --socket-name=/tmp/emacs1000/server

emacsclient 26.1 emacs 26.1 Magit 20180604.958, Git 2.17.1, Emacs 26.1, gnu/linux My emacs is configured to work in a daemon mode when I'm trying to commit a staged file, I get this: GitError! There was a problem with the editor…
DmitrySemenov
  • 9,204
  • 15
  • 76
  • 121
4
votes
1 answer

How can I use interactive pre-commit hooks with magit?

Is it possible to configure magit so that it spawns an interactive shell for pre-commit hooks that require user input? For an example of one such pre-commit hook, take a look at git-confirm.
Jake Zerrer
  • 304
  • 2
  • 9
4
votes
2 answers

magit for `pull --rebase upstream` (not origin)

Let's say we have an upstream git repository which is the official home of a project, and origin is our own remote git repository (e.g. a github fork). On the command line, I would rebase to the master before issuing a PR with git pull --rebase…
fommil
  • 5,757
  • 8
  • 41
  • 81
4
votes
1 answer

How do I merge branches with Magit using a new commit object?

I can’t seem to get my merges intact with Magit for Emacs without squashing them into the current branch consistently. Sometimes a new commit object is created after the merge (which is what I want), sometimes commits are squashed. I basically just…
ESWAT
  • 153
  • 10
4
votes
2 answers

Turning off magit-mode commit formatting

The recent-ish version of Magit (M-x magit-version says magit-20131222.850) I'm currently using enforces certain annoying properties on commit messages, and colors them oddly. Specifically, it auto-breaks lines at a certain length and colors the…
Inaimathi
  • 13,853
  • 9
  • 49
  • 93
4
votes
1 answer

collapsing all diffs in magit?

Sometimes in a long commit log, it's really painful to navigate the all-expanded diffs. (You get expanded-diffs when hitting enter from the magit-blame-mode for example) Is there a way to collapse these diffs?
eugene
  • 39,839
  • 68
  • 255
  • 489
3
votes
2 answers

What is the best way to use "git add -p" in emacs on Windows?

Problem: git add -p seems unusable in either emacs shell or eshell magit (a frequently suggested alternative to using git from the shell in emacs) sucks balls on Windows (it's horrendously slow.) Keeping a cygwin window open and using that for git…
user15486
3
votes
0 answers

Magit: how to do an octopus merge?

I've been working with magit for a few months, and I'm gradually coming to use it to do more and more git actions, but I still haven't figured out how use magit to do an octopus merge. In these cases I still need to open the shell and write out the…
3
votes
0 answers

Magit with-editor issue

I have installed magit-2.11.0 and I can run magit-status fine. However when I do magit-commit I run into this error: "Symbol’s function definition is void: magit-run-git-with-editor" I see that this function is being called at various…
aartist
  • 3,145
  • 3
  • 33
  • 31
3
votes
1 answer

Magit checkout hunk / revert hunk

File contents in HEAD commit: A B C D After I modify the file, the contents is: A A2 B C D D2 If I would like to revert the change at line 2 (A2), how can I do this with magit? So the result would have the contents be: A B C D D2
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
3
votes
0 answers

Emacs: magit status failed on ssh remote server repo

I'm using ssh to connect to a remote server. On the server there is a git repo called MRFLSSVM. However, when I execute magit-status on: /ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/ Magit asks me to Create repository in…
spacegoing
  • 5,056
  • 5
  • 25
  • 42
3
votes
1 answer

What is the equivalent of `git clean -f -d -x` in magit

I expect to be able to z -a z in magit-status and be able to stash pop / z p without problems. However stashing everything in magit apparently does imply saving ignored directories to the stash, but not delete it from the working directory. The…
hbogert
  • 4,198
  • 5
  • 24
  • 38
3
votes
1 answer

Emacs Magit: how can I see differences between a given branch and unstaged changes?

With git I can see the differences in a file relative to any other past commit as: git diff commit file_name This shows me the differences in file_name between the version in commit against my current unstaged changes. With Magit I can choose a…
Alejandro
  • 1,064
  • 1
  • 8
  • 22
3
votes
1 answer

emacs magit: git-dir is not in the default place

If git-dir is not in work-tree, we can use the command line git --work-tree=/a/b --git-dir=/c/d/ status to run git. How can we use magit in this situation? Thanks.
user3208
  • 155
  • 3