Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
770 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
150 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
203 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
269 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
583 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
134 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
84 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
86 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
173 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
99 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
169 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
87 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
295 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
163 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 ...
5
votes
1answer
2k 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
365 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 ...
5
votes
3answers
158 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
442 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
884 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
74 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
141 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 ...
2
votes
1answer
809 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
387 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
206 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
57 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
106 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
200 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
441 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
52 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
284 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
531 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
98 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
194 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
105 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?
0
votes
1answer
158 views

Version control using emacs

I'm looking for a simple version control system. I'm the only programmer in my team and I would be the only one who is making changes to files. It gets complicated when the inputs change and I ...
3
votes
1answer
521 views

How do you do “git checkout — .emacs” using magit?

When a file (like .emacs for example) is modified in a Git repository, if I want to git pull git refuses to do so because I have a modified file. Git proposes to remove the modification by doing git ...
3
votes
3answers
519 views

How do I toggle Magit enumerating untracked files?

git status in my configuration is extremely slow at enumerating untracked files, for reasons not relevant here. I'd like to have Magit use the -uno argument in most cases, in order to avoid a long ...
0
votes
1answer
24 views

Why does magit-git-lines differ from git output in this case?

~/github/hub $ git rev-parse HEAD 4777bd363058213605ebb292b35ef1a6edb3663c ~/github/hub $ git --no-pager log \ --grep='\[ci skip\]' --invert-grep \ --format=oneline --...
0
votes
1answer
198 views

Can I exclude .git/COMMIT_EDITMSG from file-name-history?

Is there a way to exclude .git/COMMIT_EDITMSG files from file-name-history? Now that I'm authoring commits with Magit, those commit message files are often the most recent entries in file-name-history,...
1
vote
1answer
98 views

How to GPG-sign a commit when reverting in Magit?

When I commit in Magit, I have the option to "Sign using GPG". But when I revert a commit in Magit, I don't see this option. Is it hidden? If so, how do I activate signing in that context? Otherwise, ...
32
votes
2answers
4k views

How to list branches with Magit

How do I list the branches of a repository in Magit (i.e., the equivalent of git branch --list)? I expected to find this in the branch popup, but it seems to be neither there nor was I able to find it ...
4
votes
1answer
1k views

Magit equivalent of `git branch -D -r origin/feature/someLabelHere`

On the command-line, I often do this git branch -D -r origin/feature/someLabelHere to remove a remote branch after a pull request from that branch has been merged into master. I know now to do git ...
10
votes
2answers
1k views

Magit - How to expand all and collapse all sections in magit-status

Pressing TAB on a single unstaged file shows or hides details pertaining to that file. How do I show & hide (toggle) details of all unstaged files at once? I did come across outline-hide-...
2
votes
2answers
180 views

Discarding modified hunk at current position

I'd like to discard modified hunks (and ideally, view the diff before) basing on the current buffer position. I have diff-hl so that it's quite obvious which part of a buffer are modified. Now, how ...
0
votes
1answer
310 views

Magit equivalent to 'git push origin HEAD'

I usually use git push origin HEAD on the command line when I want to push my local branch to GitHub for the first time. That way I don't have to type the branch name. What is the equivalent in Magit?
1
vote
1answer
59 views

Make changes to staged files in Magit

IntelliJ has a nice feature in the overview of the staged area, where you can make changes to the files in the staging area while having the diff overview. In the Magit overview of staged changes I ...