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
21 views

What's this `slot-missing: Invalid slot name: “#<transient-prefix transient-prefix>”, :incompatible`

After updating to magit 20190517.1750 from ELPA, I've got this warning slot-missing: Invalid slot name: "#<transient-prefix transient-prefix>", :incompatible which breaks a lot of magit ...
0
votes
1answer
19 views

How do I select 'flag' options for magit through helm?

I'm using spacemacs with helm and magit. There are some options, for example, the ability to sort log entries in reverse order, that have a flag by them. I don't know how to select any of these ...
0
votes
0answers
31 views

Fast data entry form something like org-agenda or magit

I would like to use emacs to enter data -- to start with, essentially a set of numeric responses to a list of questions. The questions will usually be the same every day, but will change slowly over ...
0
votes
1answer
19 views

How to reproduce `git push -u` behavior, that is, auto-set local branch as the new remote or push branch?

No matter how I fiddle with magit options, I cannot reproduce the following behavior: I checkout origin/master. I create a new feature-branch on top of it; its name is unique. I make changes, add ...
0
votes
1answer
18 views

How to close the current frame automatically after aborting the commit

For editing messages, Magit opens a frame. It disappears if I finish the editing session, but it stays if I choose to cancel the session. In the latter case, I have to manually close the frame. So I ...
2
votes
0answers
13 views

How to prevent magit with ivy from selecting an author email address? [duplicate]

I have a git repository containing commits with 3 of my email addresses. When I try to view the log and filter by author (-A) and then enter a few letters of my last name, I see a list of the 3 email ...
0
votes
1answer
21 views

How to specify multiple patch files to be applied by Magit?

The Magit user manual says in the description of `w w' (magit-am-apply-patches): w w (magit-am-apply-patches) This command applies one or more patches. If the region marks files, then those ...
0
votes
1answer
30 views

Magit blame only last commit (or range of commits)

Can I have magit-blame somehow only show the changes introduced with the last commit? EDIT: what have I attempted? I've looked at the docs of magit-blame and explored all flags in the magit-blame ...
0
votes
0answers
24 views

Magit Tramp not showing dif window

When using magit on a local file, I stage my changes and I then press c and c again to commit. I get a new window showing the diff and a window for the commit message. I write my commit message press ...
2
votes
1answer
54 views

How to delete ^M in the diffs of Magit?

I had an issue with a file that had inconsistent line ending. My file would show a ^M for every line ending. I ran into this article that shows how to get rid of the ^M character and set the buffer ...
1
vote
1answer
35 views

Package to help display status of each git repo contained in a common directory

I have a directory and in the directory is a rather long list of git repositories. Is there a package or options where a dired listing of the directory would also add in the status of each git repo ...
0
votes
1answer
63 views

How to integrate Emacs + Lab + Magit

I'd like to use lab hub wrapper for handling mr/issues of my own custom gitlab server. When I open a pull-request using hub (github) it's works fine the git-commit-mode from magit, syntax highlight ...
0
votes
1answer
40 views

Run a function before/after magit runs git

I'd like to run a function before magit runs git, and another one after magit runs git. I see magit-pre-start-git-hook but I don't see any post-finish-git hook. How can I run commands before and after ...
0
votes
1answer
168 views

Use magit to display the difference between two branches

Is there a way to bring up a big list of the differences between specific commits across two branches? I tried the method described in this answer but it came back empty, I assume because the ...
1
vote
1answer
63 views

Mode-line not updated after checking out new branch using Magit

I create and checkout a new local branch via magit. Pressing M-x magit-status then b c for branch create and in the magit buffer I see the new name of the branch that I am apparently on. However ...
0
votes
1answer
26 views

magit options when dealing with a failed git-am

I'm not sure if I'm missing something or if this is a missing feature but occasionally when I attempt to apply a patch from my mail box git completely fails to apply it. This isn't a case of ...
0
votes
1answer
61 views

How to ask magit to use external diff and merge tools?

I have set the git variables [merge] and [diff] to the appropriate values like this: [merge] keepBackup = false; tool = p4merge [mergetool] prompt = false [mergetool "p4merge"] cmd = ...
0
votes
2answers
123 views

How to create a new repository on Github from Magit

I am unable to add a remote repo to github if it does not already exist on github. E.g. magit-init Add some files, stage and commit. Then magit-remote-add --> Remote name:github --> Remote url: ...
1
vote
0answers
63 views

Magit throws error when I press “h” or “c” [closed]

I have installed Emacs on a fresh install of Elementary OS, and I have just installed Magit. When I run magit-status in a repository, and press either the c or h key, magit throws an error. The error ...
3
votes
2answers
87 views

Limit magit to showing status of 1 directory

I'm working on a large repo with many folders, and showing the status is slow (just plain git takes a long time). I am really only interested in one directory, how can I constrain magit to only seek ...
4
votes
1answer
74 views

Magit unignore file

When in magit, I pressed i on a file and asked if I would like to ignore the file locally or globally. I chose locally. I assumed that it would write a line in my .gitignore file but unfortunately ...
5
votes
2answers
114 views

Pushing/Fetching all branches at once in magit

Context: I have a relatively small project, in which I use branches to work on new features, so that when I'm finished, then I manually merge branches as I need. I usually keep the same exact copy of ...
2
votes
1answer
79 views

How to modify fringes only for magit mode?

I have tried: (defun my-change-fringes () (set-window-fringes (selected-window) 20 0)) (add-hook 'magit-mode-hook 'my-change-fringes)) The problem seems to be that when I open a magit buffer for ...
-1
votes
1answer
46 views

Magit: add a full directory with magit-status

How can I add a full new directory with magit-status? When trying to stage a new directory from the magit-status buffer, pressing s, I can only add individual files within the directory, but not the ...
2
votes
1answer
69 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 ...
0
votes
2answers
70 views

Magit: Getting to the current/editable version of a file from a commit/diff view

Very similar to this question, particularly the second part to this answer: From the diff view of a specific commit, is there a way to jump to the current+editable version of a modified file? If I ...
1
vote
1answer
45 views

Can magit commit with all (-a / --all) instead of “.” by default?

When using magit-commit-create, internally it runs something like... git commit . instead of... git commit -a Is there a way to make magit use -a / --all by default instead? Note: this is an ...
5
votes
1answer
44 views

Show blame information for a line from the *magit* buffer

There's a workflow I tend to do fairly often and I wonder if Magit could help me. I've made a bunch of git commits on a branch, I haven't pushed them yet, and I notice a small mistake in my unpushed ...
2
votes
2answers
114 views

How to configure git and magit to stream line making pull requests?

From the main repository on github, I created a fork on github and I keep the master branch of my fork up to date with the main repository by doing: git checkout master git pull upstream master git ...
0
votes
1answer
62 views

How to prevent Magit from saving COMMIT_EDITMSG?

When I hit c c in the Magit buffer it opens the commit message buffer. Then I write my message and type C-c C-c to close it. For some reason it saves .git/COMMIT_EDITMSG and every next time when I hit ...
3
votes
2answers
48 views

How to turn off Magit default switch (--reset-author in Commit)

I did something causing the -R (--reset-author) switch in the Commit menu to always be on by default. How can I reset this?
2
votes
1answer
77 views

magit-run-git-with-editor: Invalid function: with-editor*

today, using magit, I've started getting the following error message when I hit c to commit : Terminal is dumb, but EDITOR unset In the *Messages* buffer, I also get: magit-run-git-with-editor: ...
1
vote
1answer
36 views

How to detect programmatically if content under org-mode headline is encrypted or not before a save or commit?

org-mode allows users to encrypt the contents under a headline by adding the crypt tag with C-c C-q crypt and then calling M-x org-encrypt-entry. Below is an example using this feature: * Headline ...
0
votes
2answers
52 views

Set magit timestamp format with function

I would like to have my git timestamps in UTC. Currently attempting to commit using magit gives Wrong type argument: sequencep, my/magit-timestamp-utc Here's the code: (defun timestamp-now() (...
0
votes
1answer
49 views

How rollback settings without restart Emacs?

windows 10, emacs 26.1 In my init.el (with-eval-after-load 'magit-status (define-key magit-status-mode-map (kbd "C-<tab>") nil)) This disable C-<tab> after magit-status was load. And ...
0
votes
1answer
42 views

Magit: How disable C-<tab>?

windows 10, emacs 26.1, I use package magit to work with git. Nice. When I press C-<tab> is collapse/expand recent commits: Nice. But if I press <tab> magit do same thing as when I ...
6
votes
1answer
228 views

How to perform an automatic commit with predefined message using Magit?

I have a repository of org files which I mostly use for note taking and tracking, and I track it using git. I want to add a shortcut that would quickly commit all current content of the repository (...
1
vote
1answer
139 views

How to diff a single, unstaged file in magit-status?

How can I display a diff for the actually selected file in magit-status? What can I do in do display a diff of build/conf/local.conf? With the now deprecated git-status, I could run git-diff-file (...
0
votes
1answer
44 views

Ignoring specific remotes when running `magit-log-popup` to log all branches

I would like to add an option in magit-log-popup to ignore a list of remotes when using "Log all branches" (l b). What I'm trying to do is something like this git log HEAD --branches --remotes --not -...
1
vote
2answers
72 views

Prevent any form of ESC from closing a magit buffer

I'd like to be able to prevent Magit from closing a buffer when I press ESC. I also want to prevent my evil-escape-mode sequence (kj) from closing it as well. Running C-h k ESC gives <escape>...
0
votes
1answer
33 views

How can I get git-gutter:next-hunk to NOT loop around at buffer bottom?

As per the title, I would like to stop processing at the end of a buffer and not loop around to the top. I find it easier to keep track of what I am doing that way. TIA.
2
votes
1answer
77 views

Can I automatically see pre-commit hook output when committing with magit?

A coworker has just set up our main repo to use overcommit. It's lovely, and keeps us from invoking long CI builds which will fail for trivial reasons by warning us about issues using pre-commit hooks....
1
vote
1answer
58 views

How can I add custom shell command in magit?

In my project, I write scripts to deploy it to server. Here are the commands: npm run deploy:internal npm run deploy:staging npm run deploy:production I want to add custom shell commands to magit, ...
1
vote
1answer
32 views

what to do with “magit-wip-commit-worktree: Cannot read tree refs/heads/master”?

When I commit via magit I get: magit-wip-commit-worktree: Cannot read tree refs/heads/master while it commits ok. But the message frightens me. There seems to be nothing wrong with the repo: $ ...
4
votes
1answer
135 views

Magit commit mode does not open anything to edit with

I recently installed Magit and began running it. It appears to load just find and all keybindings seem to work perfectly. However, when I intend to commit changes, magit doesn't seem to open my ...
1
vote
1answer
33 views

Error (ssh-agency): ‘/usr/bin/ssh-add’ failed with status 1:

(I am using MAC OS High Sierra v.10.13.6) with Emacs v26.1 When attempting to push changes to a remote-repo (Github) using the package magit I received the following error in the buffer. Error (...
0
votes
1answer
37 views

magit-diff-visit-file key bindings

While point is inside a diff in a Magit buffer I press RET, which invokes magit-diff-visit-file. After checking this file, I want to quit it and get back to the Magit buffer that was previously ...
1
vote
1answer
156 views

Magit status is slow on Linux insided virtual machine but fast on native MacOS

In OSX El Capitan, I am using Magit 20171026.217, Git 2.10.1 (Apple Git-78), Emacs 25.1.1, darwin. In CentOS Release 6.6, I'm using Magit 20180903.2339, Git 2.13.1, Emacs 26.1, gnu/linux. For the ...
2
votes
1answer
297 views

Recover/undo discarded changes in git/magit on unstaged files

I accidentally pressed "k" (a magit command) and discarded some unstaged changes. Is there a way to undo this? Or did I discover one of the few ways to actually lose work while using git?
1
vote
1answer
113 views

Magit: patches that ignore some whitespace changes do not apply

Context: I'm doing a merge, and fixed the conflicts manually. Now I'm trying to stage changes hunk-by-hunk and make a commit. Issue: some hunks are not getting staged. Here's the output from magit-...