Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [magit]

is an Emacs extension for the Git version control system.

0
votes
1answer
101 views

Magit + Emacs + Windows: 7 alert dialogs on first use?

Background The first time I run magit-status after starting Emacs, I get a series of 7 alert dialogs popping up. Each one just says "emacsclient 25.1" and has an OK button. They don't seem to do ...
13
votes
1answer
783 views

magit blame: is there an equivalent for “show me the file before this commit” from VC?

VC blame mode has a nifty a hotkey "show me blame of the file before the commit I'm pointing at". Is there an equivalent in magit?
1
vote
2answers
238 views

Using ido completion for selecting a repository for magit

I like to use ido for completing file paths and helm for all other things. I have tried setting magit-completing-read-function to magit-ido-completing-read. This doesn't change magit-status behaviour ...
3
votes
2answers
1k views

Magit how to use ssh key rather than being prompted for password

I've seen the question here but I'm not sure if the same solution would apply to me https://emacs.stackexchange.com/questions /17866/magit-how-to-use-systems-ssh-agent-and-dont-ask-for-password/17890#...
1
vote
1answer
111 views

Write function that runs a command only after a previous command finishes

I would like to create a function that runs a command only after a previous command that takes some input from the user finishes running. In particular, I would like to write a function that runs a ...
3
votes
1answer
318 views

Can magit show if a branch is ahead or behind?

Git hosting web services like Bitbucket Server and GitHub provide a branch view that shows whether branches are ahead or behind master: This is great for finding remote branches which have been ...
1
vote
2answers
244 views

use nonstandard `.git` directory with magit

I have been using the setup described on the top comment here to manage my dotfiles using git. In short, I have this in my .bashrc: alias config='/usr/bin/env git --git-dir=$HOME/.myconf/ --work-...
2
votes
2answers
235 views

Add (copy) to kill ring current branch name with Magit

Is there a way to easily copy the current branch name in Magit via M-x? At the moment I open the status pop up magit-status and copy the name from there. Best & thanks for your help!
0
votes
2answers
1k views

How to get Exec-path-from-shell working in Spacemacs

I'm using the latest version of emacs, with and without a custom MacOS build (homebrew-emacs-plus). So, I'm trying to use spacemacs on MacOS, and I can't get it to pick up the $PATH on my host system. ...
1
vote
1answer
45 views

I get a warning loading magit sometimes

In magit-repolist-mode: magit-repos.el:151:9:Warning: assignment to free variable ‘x-stretch-cursor’ In magit-submodule-list-mode: magit-submodule.el:332:9:Warning: assignment to free variable ‘x-...
0
votes
2answers
438 views

How to create a new patch set in gerrit

I'm using magit and magit-gerrit, for easy changes, and reviews it works well, but I cannot figure out how to add a new patchset to a change that it is in gerrit
1
vote
2answers
103 views

magit to honour file-local tab-width variable

Some of Python files I work on have the following file-local variables: # Local Variables: # mode: python # python-indent-offset: 4 # tab-width: 4 # indent-tabs-mode: t # coding: utf-8 # End: When ...
1
vote
1answer
841 views

magit “empty ident name (for <(null)>) not allowed” on commit

On Windows 10, after staging a file in magit and attempting to commit it I get this error message instead empty ident name (for <(null)>) not allowed
1
vote
1answer
155 views

Magit refs buffer no longer able to switch branches

After last update, the *magit-refs buffer no longer switches to the branch under point when pressing RET, instead, it shows last commit from the branch I wanted to check out (completely useless ...
0
votes
1answer
220 views

pull failed from magit, but pull works on command line (windows 10)

When pull from magit on windows 10 (spacemacs), the error is: 1 C:/Program Files/Git/mingw64/libexec/git-core/git … pull origin fatal: Could not read from remote repository. Please make sure you ...
5
votes
2answers
301 views

How to follow commit hashes in commit messages?

Some commit messages contain sha1 hashes of older commits in order to reference these commits, e.g.: Fixes: deadbeef Is it possible to visit the referenced commit from the first commit message?
3
votes
1answer
657 views

magit: commit without whitespace-only changes

Is there a way to commit only the lines with non-white-space changes? I have (add-hook 'before-save-hook 'delete-trailing-whitespace) in my .init.el and this usually helps me avoid committing ...
6
votes
1answer
139 views

How to hide the username in magit-log?

Trying to utilize a small screen, and I did this once before, so I know it's possible. How to hide the username in magit-log so that only the commit message is visible?
3
votes
1answer
87 views

Does git-messenger support showing a commit using Magit?

In this issue in git-messenger's issue tracker it was suggested that it should optionally use magit-commit-mode to show commits in a separate buffer. And that issue was closed as resolved. But it ...
0
votes
2answers
88 views

Warning assigning variables

I'm rebuilding my emacs configuration, and trying to compile without warnings. I'm using also cask. I have this case: (require 'magit) ;; Enable a right limit of 70 chars for git logs (add-hook '...
0
votes
1answer
180 views

Can I edit a commit message in Magit before the commit is started?

I tend to write the commit message as I go along and stage changes. At the moment I use a scratch buffer for this, but it would be nicer if I could edit it in Magit from the start. Is this possible ...
2
votes
2answers
100 views

VM causing magit not to work

I have this error when I start emacs: File error: Searching for program, no such file or directory, git My Git is inside the VM in /usr/bin/git How can I point emacs to it? I'm using tramp and ...
1
vote
1answer
184 views

Rebase --onto with Magit

Is there a way to do the following rebase in Magit? git rebase --onto master next topic Thank you
2
votes
1answer
89 views

Does magit support interactive git hook?

My git hook would prompt for answer yes/no when do the push. How could I get the prompt and enter my input when using Magit?
3
votes
1answer
333 views

Magit - How to update a branch without using checkout?

While working on a project, it is necessary to pull some branches from remote and merge into current branch. To update another branch, we have to Stash local changes on current branch Checkout to ...
2
votes
0answers
199 views

How to show word diffs in Magit? [duplicate]

Some people put one sentence or even one paragraph on one line. When someone fixes a spelling error in such a line it is difficult to spot the change in Magit log. How can I toggle Magit log to show ...
6
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 ...
7
votes
1answer
372 views

Magit: how remove push branch?

I want to remove the push branch for a repository. I only use merge branch to push to a remote repository and now I have two headers with the same info all the time: Head: master Merge pull ...
6
votes
3answers
180 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 ...
6
votes
1answer
463 views

Magit: show ignored files

Is there a way to get the output of git status --ignored in a Magit buffer? Preferably in a way that would make opening ignored files easy.
7
votes
3answers
963 views

Magit Status - always split vertically

Is there a configuration option in Magit that will force the "git status" window to always appear in a vertical split? I didn't see anything about that in the documentation, and Google was rather ...
3
votes
1answer
77 views

How can i make toggle shortcuts like org mode or magit

I am writing an elisp package currently I am using hydra, I would like to be able to have shortcuts you can toggle on and off for various flags. You see this sort of thing in magit and org mode when ...
2
votes
1answer
153 views

How to show merge-base in Magit?

Is there a way to visually show the merge-base of two branches in Magit? I think it should be easy to do, there's git merge-base that returns the SHA1 of the commit, so maybe we could mark it in the ...
3
votes
1answer
898 views

Magit equivalent of 'git remote add origin git@github.com:user/project.git'?

For those who are trying to determine how to do this here is the answer. Yes the answer is in the docs! I missed it on the first pass. Then looked at questions such as the below, trying b u and ...
5
votes
1answer
423 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 ...
0
votes
2answers
216 views

Use remote git executable for magit and git-gutter when file system is SSHFS

How can I use a remote git executable for all git operations when accessing a file via SSHFS? I mount a remote system's git repo via SSHFS on my local computer. The git repo is medium-sized with ...
0
votes
1answer
71 views

`magit-bisect` with Emacs sources

Trying to magit-bisect-start in Emacs source code with the bad commit being emacs-24.5 and good being emacs-25.1 does not seem to work. Nothing is shown in the Magit buffer. Doing the same with other ...
0
votes
1answer
58 views

Emacs init file with yasnippets and magit submodule update error

I have cloned yasnippets repo repo in ~/.emacs.d/yasnippet-snippets. I would like to synchronize it each time I start Emacs (btw, it would be nice to do it only if there is a connection available), my ...
2
votes
2answers
1k 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 ...
1
vote
1answer
111 views

Yasnippets won't expand in git-commit-mode?

I have written a snippet for git-commit-mode. However when I'm writing a commit message (from Magit), the snippet won't trigger. Does anyone know how to fix this? I have yasnippet version 20160924....
0
votes
1answer
207 views

magit - triangle workflow with branches in fork

I am using a triangle workflow. Upstream is called upstream and my forked repository is called fork. I want to have multiple branches and each of those branches should exist both locally as well as ...
2
votes
2answers
492 views

How to view each commit in magit easily?

When I press ll in Magit's status buffer, then it shows a log buffer listing commits. Then I want to show details about the commit at point in another window, but at the same time I want to stay in ...
1
vote
1answer
54 views

Push only part of the history with magit

I’m creating a big feature in one of our projects, that is close to around 20 commits in my local repository. Most of them are still subject to change with rebasing, but I’d like to push the first few ...
1
vote
3answers
315 views

how to supply universal-argument (C-u) to a function call inside a binding statement [duplicate]

I have this on my init.el ;; magit status (define-key evil-motion-state-map "gs" 'magit-status) But I would like to have another binding, for C-u M-x magit-status (C-u is the universal-argument) ...
1
vote
2answers
52 views

How do I jump from a diff hunk to the relevant commit(s)?

I am reading a diff between two revisions, say A..B, possibly limited to a single file. Once in a while, I stumble on a hunk that I’d like to investigate in detail. I want to press a key or two and ...
3
votes
2answers
682 views

Magit git diff between two specific SHAs

Using git cli I would execute git diff SHA#1 SHA#2 How does one do the equivalent in magit?
0
votes
1answer
104 views

Magit equivalent of `git checkout <tree-ish> <path>`

I would like to reset my working directory to the state in another commit. In pure git, I'd use git checkout <commit> -- <file>. Is there a way to reach similar functionality from any of ...
3
votes
1answer
201 views

How to execute emacs commands in background

When executing some time consuming commands like magit-status or using scp to transfer files, then Emacs freezes and waits for return. Is there any way I can tell Emacs to run those commands in the ...
7
votes
1answer
1k views

Magit doesn't recognise git repo through ssh connection

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 ...
0
votes
1answer
107 views

How to remove git stashes when inside magit-status

Inside the magit-status, I see tons of stashes. Can I removed them by pressing a key on the keyboard?