Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
12
votes
2answers
2k views

How do I force a specific buffer to open in a new window?

When committing changes in Magit, it is useful to have the diff view open while adding details about the commit. In Magit, we see the diff in the *magit ..* buffer. When you hit cc while the cursor ...
1
vote
1answer
219 views

Magit version post-installation does not look as in the manual

I have just installed Magit from Melpa as per the instructions in the official Magit manual. I then proceeded to follow the manual's Post-Installation Tasks section, which states After installing ...
9
votes
1answer
5k views

How do I set the upstream branch to push a local branch to in magit?

From what I remember, if I am working on a branch, e.g., my-feature-branch, I used to be able to do this from the magit-status menu with P P, and then selecting the remote branch from a list which had ...
2
votes
1answer
744 views

Magit show git hook output

I'd like to configure magit so that when I decide to commit my changes I'm shown not only the buffer to edit commit message and the diff of changes but also the magit-process buffer. Is there a way of ...
14
votes
2answers
4k views

Magit extremely slow in Windows. How do I optimize?

I am forced to use Windows 10 for a project. Yes, I would rather use GNU/Linux. To keep my sanity, I've tried to regard Windows as a bootloader for Emacs :) Unfortunately, Magit (one of my favorite ...
9
votes
1answer
408 views

How to well deal with the git diff with compatible to visual-line-mode?

I typeset my manuscript in org-mode with visual-line-mode turned on. Physically one of my paragraphs is just a line which is soft-wrapped. In this case, when I tried to git diff (magit) to see what I ...
7
votes
2answers
3k views

How to install a specific version of package?

When I do M-x package-install RET magit it installs the latest version of magit which is 2.1.0. I want to install magit 1.4.2. I don't want to do it manually by downloading and loading package. ...
6
votes
2answers
175 views

How to extend magit's context-sensitive push menu?

I'm using git to maintain a web site located on a remote server. My workflow has been as follows: Stage and commit changes to the web site (can do with Magit) ssh to the remote site and pull the ...
7
votes
2answers
805 views

Magit + gerrit - push to other branch

I am using gerrit. When I want to push my commits, I use following command: git push origin HEAD:refs/for/master How can I recreate the same command using Magit?
3
votes
1answer
398 views

Magit asks for passphrase for ssh key every time

Running emacs 25.2.2 magit 2.12.1 on Kubuntu 18.04. I have set-up ssh keys for my bitbucket repository and I run ssh-agent on start. When I fetch or pull or push, magit asks for the passphrase for ...
2
votes
1answer
436 views

Remove key binding in magit-status-mode

I have C-RET set to other-window globally. For modes that would override this I manually add a hook to the mode's key map, e.g. (add-hook 'magit-log-mode-hook (lambda () (local-unset-key (kbd "<C-...
0
votes
1answer
440 views

Magit: How reset-soft to specific commit?

List of my branches: develop features/magi master Current branch is features/magi. I want to reset from current commit (commit 3) to previous commit (commit 1). So I use command: magit-reset-soft ...
0
votes
3answers
398 views

New Magit interface: no actual “push”

I give this new interface the benefit of a doubt, but I'm close to just removing this version and going back to something earlier and more friendly. There appears to be no way, at least not on the ...
0
votes
1answer
64 views

Magit status wired output (control sequences)

When I use magit on a RHEL 7 box today, it gives me this output when checking magit-status: Not sure what went wrong. Magit-version output is: Magit 2.11.0, Git 2.14.1, Emacs 25.3.1, gnu/linux The ...
39
votes
4answers
8k views

Add change to a previous commit with Magit

I have 2 commits, A then B, ready to be pushed. I realize I forgot to add something in A. How can I add this change to A using Magit? I don't even know which part of the Git documentation I should ...
44
votes
4answers
10k views

Change a branch's upstream with Magit

When you push a branch with Magit (with P P) and the branch has no upstream, Magit asks you the name of the branch you want to push to. That's great. Once you set the upstream for a branch, however, ...
39
votes
2answers
7k views

How can I open a specific revision of a file with Magit?

Is it possible to open a specific revision of a file in Emacs with Magit without changing the current branch? I have rebased some local changes to a revision where the modified functions were ...
18
votes
3answers
4k views

Magit, how to use system's ssh agent and don't ask for password

I've googled and read the FAQ and Wiki for Magit, but still unable to figure this out, all I find are answers about Windows... How can I configure Magit to use my running ssh-agent session and don't ...
29
votes
3answers
3k views

Magit split hunk into two hunks

There's a question on SO about splitting hunks using magit, and the two solutions given are to either stage the region (mark a region, hit stage), or to shrink/grow all hunks using + & -. That's ...
23
votes
3answers
9k views

Untrack file without deleting it?

I have a tracked file in a git repository. How do I untrack this file without deleting it using magit?
20
votes
1answer
1k views

Magit equivalent for “git remote -v” (list remotes)

I'm wondering if there is a magit equivalent to git remote -v to list remotes and their URL's defined on a git repository. The magit remotes popup offers options to add, remove, rename, and set url, ...
15
votes
2answers
942 views

Magit log dates

In Magit log buffer commits (one per line) are shown with relative date. This is nice for recent commits, but makes little sense for older changes. In particular, this makes it annoyingly hard to ...
14
votes
2answers
1k views

Git: is it possible to stage a selected region directly from the file buffer?

With Magit you can open the magit status buffer, press TAB to expand the diff (or RET to bring up a separate diff buffer), mark parts of a hunk and press s or u to stage/unstage the region. Really ...
14
votes
2answers
932 views

Manage several git repositories from magit

I'm maintaining several git repositories using magit, and their numbers keep growing. Is there a way to inform magit of all these projects so that a single command would present a summary of the ...
10
votes
7answers
1k views

How to Implement Popup Menu Similar to That Used in Magit

Question I would like to create user interface in form of popup menu, popup menu similar to that used in Magit. Features Definition of Popup Popup in context of this question means little ...
8
votes
1answer
3k views

Magit diff side by side

I would like to know if there is a way to get the standard side by side diff view in magit. That is, instead of seeing the old code chunk and the new one one after the other, I'd like to see them on ...
5
votes
1answer
494 views

Magit and GitHub personal access tokens

What is the best way to use Magit with GitHub personal access tokens? Right now, pushing to GitHub causes Magit to prompt me for a username and password. I have to provide the access token instead of ...
14
votes
5answers
1k views

How can I make `--verbose` flag be enabled by default in magit commit screen?

Right now, instead of pressing just cc in magit-mode, I have to press c-vc every time to enable --verbose. Is it possible to make it enabled by default?
8
votes
1answer
438 views

Use magit to compare all changes in two revisions

Is there a way to invoke Ediff from Magit in order to compare the changes to all files between two revisions, not just the changes in a single file? My use case is a coworker will ask me to review ...
7
votes
3answers
259 views

A way to insert a predefined text into Magit's commit message window?

We have a convention that every commit message begins with an issue number. I'd like to be able to programmatically insert the issue number part (computed by a separate function) into the commit ...
4
votes
1answer
258 views

Magit show status on selected directory

I have a git repo and I have changes in different directories. user@box:~/myrepo$ git st On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git ...
2
votes
2answers
114 views

How to make “canned commits” in magit?

At work we have several different commit messages that are used for every feature branch: branchname initial branchname ready for review branchname passed review branchname done plus a few more that ...
7
votes
1answer
649 views

Meaning of magit status buffer: Head, Merge, Push

Can someone explain what the top three lines of the magit status buffer mean? Especially Merge: origin/master Commit message Head: master Commit message Merge: origin/master Commit message ...
5
votes
2answers
204 views

magit-status doesn't use the whole screen size in 2.3

In previous versions (before 2.3) M-x magit-status showed the status buffer taking the whole size of the current window. However, now it instead pops up a half-sized buffer (like e.g. C-h f does). ...
4
votes
3answers
816 views

Magit always use current branch to create new branch

I am currently on master branch and I have to create new branch called test starting from master. If I run b c in magit buffer, magit will prompt for starting point Create branch starting at (...
3
votes
2answers
2k views

How can I compare two commit diffs in magit?

I want to directly compare the diffs of two commits in emacs (rather than seeing the diff of two trees at given commit points). A bonus would be being able to use ediff mode to compare the two ...
2
votes
1answer
158 views

Why isn't magit-version available?

I have Git 2.5.3 installed and am using GNU Emacs 24.4.1 on Ubuntu. I just installed Magit from MELPA: (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (...
2
votes
1answer
309 views

How can Magit add a credential to ssh-agent?

Can I make Magit add my ssh passphrase to ssh-agent instead ask me to use the passphrase a single time? Every time I push a commit to my remote I need to type my passphrase or instead run M-& ssh-...
1
vote
2answers
308 views

magit with tramp is not working with git correctly

I installed magit. I added the following lines to my .emacs: (require 'tramp) (push "/path/to/git/directory/" tramp-remote-path) And when I am in tramp I run M-x magit-version here is the output: ...
7
votes
1answer
454 views

Magit custom commands

Magit displays the progression of multi-step commands with popup windows. For example, pressing c brings up the commit menu, whence pressing a will invoke magit-commit-amend. I would like to include ...
7
votes
2answers
528 views

Can I have the git-log “--all” option be initially selected?

When I press the "l" key in the main Magit status mode, it pops up a window where I can adjust the options to be passed to the magit log command. Can I arrange for the --all option to always be ...
5
votes
1answer
752 views

Is there a way for magit to display the branch in the dired buffer mode line for a given directory?

I'm moving to emacs from shell/Vim and I'm very used to seeing the branch I'm working in when I'm at the project level. Is there any way to get the Git branch name to display in the dired buffer mode ...
5
votes
1answer
2k views

magit: how to set default username?

Is it possible to set a default username (i.e.: my Github user name) for magit? It is prompting for the user every time I have to push a commit. Don't know if this may help with the answer, but I ...
3
votes
1answer
98 views

Running diff in Magit, filtered to only some specific files

I’m basically trying to run this command, but in Magit: git diff master..17 -- "**/*.scala" … i.e. to view changes in all *.scala files between ref/heads/master and ref/heads/17. I’ve tried setting ...
3
votes
1answer
87 views

How can I diagnose which `git` magit is running?

I'm trying to use Magit with TRAMP. The remote host has multiple git versions, necessitating (add-to-list 'tramp-remote-path "/usr/sup/bin") in my .emacs. However, when I run magit-status in a ...
2
votes
1answer
202 views

How to log file following all renames?

I upgraded to recently released Magit 2. There is a command magit-log-buffer-file. However, it logs file without --follow option, which makes it quite pointless for me (in our source code nearly ...
2
votes
1answer
222 views

“C:/c/user/…my-folder/ isn't an existing directory” error

I use Emacs 24.5.1 with Spacemacs and added Msys2 to the exec-path to use git.exe When I run 'Magit-status' I get the following error: C:/c/user/...my-folder/ isn't an existing directory. I can see ...
2
votes
2answers
271 views

Pushing with P P does not work for me

Reading the Magit user manual, there is an entry on pushing the current branch to its upstream branch, by pressing P P. This is not working for me, as I get P isn't bound to any action on the second P ...
2
votes
1answer
94 views

Font-lock for strings messes up non-code buffers

In Magit buffers, or helm-swoop, an unclosed double quote enables the string highlighting for the rest of the buffer (until another quote is found). This is how it looks like: Because of that, I also ...
2
votes
1answer
392 views

Magit commit is slow even for tiny changes

For the last few months, committing even tiny changes using magit (c c) is really slow to bring up the commit message buffer. I've profiled the code that is executing during that time but I'm not ...