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
6
votes
3 answers

Equivalent of `git add --force` to add ignored files in Emacs' Magit

I have a rule in my .gitignore to ignore .pdf files in my current git repo. But I'd like to add a pdf in particular to my commit (example.pdf). I'm working with Emacs and Magit. In a Linux terminal I would usually type: git add example.pdf…
6
votes
2 answers

Emacs + magit - vertical blame

I recently decided to switch from vim to spacemacs, which has already magit included. When working with Vim it is very easy to show :Gblame, and it shows vertical menu with commits, its author and side by side code (similar how to original git blame…
Michał Darda
  • 91
  • 1
  • 6
6
votes
3 answers

Creating Pull requests right from Emacs

I abhore manual, tedious and repetitive tasks as any normal developer should. Recently I realized - creating pull requests on numerous git repos taking up too much of my time. And most of the time you have to follow almost exact steps over and…
iLemming
  • 34,477
  • 60
  • 195
  • 309
6
votes
2 answers

Can't seem to push to GitHub using magit

I am attempting to push to a GitHub repository using Magit on Emacs 24.3.1. Note, I'm on a Windows box. I have staged and committed changes to a file and M-x magit-status reflects only untracked files that are resident to my clone of the repo. To…
PatternMatching
  • 456
  • 3
  • 14
6
votes
1 answer

Emacs -- How to push a Git repository to multiple remotes

I'm looking for some assistance, please, using Emacs / Magit to push the local repository changes to the remote website and to Github in one fell-swoop. I found a non-Emacs / non-Magit related thread ( https://stackoverflow.com/a/3195446/2112489) ,…
lawlist
  • 13,099
  • 3
  • 49
  • 158
6
votes
2 answers

magit-grep, how to include or exlude file extensions?

I'd like to give some options to magit-grep running it with option foo results in git --no-pager grep -n foo I'd like to give options to it git --no-pager grep -n foo (options to include *.html and exclude *.py, etc) It doesn't have to be…
eugene
  • 39,839
  • 68
  • 255
  • 489
6
votes
3 answers

Magit : how to see log between 2 points

I would like to know how I can see the result of command like git log ..some-branch in magit ? From the doc : Giving a prefix argument to l will ask for the starting and end point of the history. This can be used to show the commits that are in…
Adrien Coquio
  • 4,870
  • 2
  • 24
  • 37
5
votes
0 answers

Reload all open files in emacs after git branch change

Possible Duplicate: How can I get Emacs to revert all unchanged buffers when switching branches in git? I have more than 15 files of the same project open in emacs. When i change the branch in git i have to manually reload all files again. Is…
Scaraffe
  • 5,041
  • 5
  • 21
  • 20
5
votes
1 answer

How can I have Magit work with Commitizen?

I'm using Doom emacs with Magit in a repository leveraging husky to enforce commitizen "husky": { "hooks": { "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true", } } When initiating a commit (SPC g c c in Emacs Doom, or c c…
Datner
  • 315
  • 2
  • 9
5
votes
1 answer

Magit cannot connect to emacsclient inside docker?

I am running emacs24.5.1 inside docker (base image is Ubuntu). I installed emacs through apt-get. Furthermore I installed magit through melpa (magit version magit-20170702.858) and it's great. However when I try to commit something then magit…
Pushpendre
  • 795
  • 7
  • 19
5
votes
3 answers

Hide branch from modeline?

Magit is eating up a lot of my modeline to display the current git branch ... or at least I think it's magit that's doing so, honestly I can't find any way to tell where it's coming from. I can always find that out other ways and it's pushing out…
slinkp
  • 3,406
  • 2
  • 21
  • 18
5
votes
1 answer

Amending commit that is edited as part of a rebase in magit

I'm using Emacs + it's in very many ways fabulous magit-mode to work with git. There is one aspect of my workflow though that I can't map to this, and thus this question. Sometimes you have a commit which should be reworked into separate commits. I…
deets
  • 6,285
  • 29
  • 28
5
votes
2 answers

How can I configure Magit to use my Github user name?

I just configured my IRC user name for ERC with (setq erc-nick "name"). Is there a similar variable for Magit, so it knows my Github username. If not, is there some ELisp I could write to add a hook to Magit or something like that?
mwfogleman
  • 131
  • 5
5
votes
1 answer

Get the VC root in Emacs Lisp

In an Emacs Lisp function, I want to know the VC root of an arbitrary folder (if under source control), the same as something like vc-print-root-log does it. I'm trying to do it from outside the VC file/folder (though creating a temporary buffer to…
Jesse Millikan
  • 3,104
  • 1
  • 21
  • 32
5
votes
2 answers

Can't find git executable

I'm using Emacs 24 on OS X 10.6.8. Doing magit-status says Searching for program: no such file or directory, git However, the Emacs shell is able to find git, so this does not seem to be a $PATH issue. What else could it be?
Pranav
  • 3,340
  • 8
  • 35
  • 48
1 2
3
11 12