We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
1
vote
0answers
91 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
124 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
118 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
241 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
134 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
90 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 ...
3
votes
1answer
99 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 ...
3
votes
2answers
121 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
53 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
74 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 ...
3
votes
2answers
243 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
124 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
71 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?
3
votes
1answer
172 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
44 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
67 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
50 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
50 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
275 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
168 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
52 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
117 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
40 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
172 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
93 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
2answers
39 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
237 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
38 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
44 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
203 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 ...
4
votes
1answer
998 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?
2
votes
1answer
158 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-...
3
votes
1answer
66 views

How to execute a function in all files in the git working tree?

How to invoke a function on all files in the git working tree, while opening the ones which have had no opened buffers beforehand? A potential use case: Check and fix spelling in all project files ...
6
votes
1answer
203 views

Create patch for one file with Magit

With command line git you can use git format-patch [commit_hash] [file] to generate a patch for a single file. Is there a way to generate a patch in magit for only a single file? I tried marking the ...
0
votes
1answer
23 views

Opening my windows 10 project with spacemacs via samba/mount will attach wrong encoding to all files

I have a project on my windows machine. I mounted that via samba. Then I access the project with spacemacs. When I run magit now all project fiels have been modified. The actual change is that every ...
0
votes
1answer
74 views

`git add -A` equivalent for magit

I'm a very limited git user and most of the time, I just want to stage commit and push my code without too much ceremony. What's the git add -A equivalent for magit? (I want to do it programmatically)...
1
vote
1answer
55 views

Magit popup set height automatically

When the magit-commit-popup window opens, there are one or two lines that are just below the screen. Calling fit-window-to-buffer in the popup buffer fixes the problem, but I would like to automate ...
1
vote
1answer
1k views

Error (use-package): Cannot load magit

I am not sure if that is a problem on my site or more people are experiencing this. I thought at first that I broke something in my config file, but after loading by backup .emacs.d, the error is the ...
0
votes
1answer
96 views

magit push credentials

Where does magit get push credentials from? I have been using magit happily for quite some time. I installed a new (OSX) machine with the same emacs (spacemacs) config I use on other machines, yet ...
0
votes
1answer
62 views

How to get magit to ignore branches associated with closed pull requests?

I'm struggling to find a good workflow for managing pull requests from magit. (I am approving pull requests, not generating them.) At the moment I am using m p to preview a pull request and m m to ...
3
votes
1answer
99 views

Move to file position from magit-diff

diff-mode allows to move (by C-c C-c) or to apply hunk and to move (by C-c C-a) to position of original source file where hunk is placed. How can I do that in Magit Rev mode? On RET it opens buffer ...
2
votes
2answers
127 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 ...
0
votes
1answer
118 views

Track org-mode headlines separately with version control

I want to setup a personal wiki in Emacs org-mode. And I want to put this under version control, so that I can see the history of each article, as it evolves. If I use a single file for my wiki, with ...
3
votes
1answer
39 views

Exclude magit autosaves from git log --all?

I like the idea of (magit-wip-after-save-mode) but it makes git log --all (or la in Magit) very cluttered. Is there a simple way to exclude autosaves from all the autosave "branches"? On the command-...
2
votes
1answer
397 views

emacs prompting for github password

I've recently switched from spacemacs to radian and have suddenly run into magit prompting for my github password whenever I view the status of a repository (the repository is configured to use SSH). ...
4
votes
1answer
75 views

Can I move lines when committing parts of a hunk in magit?

I prefer to have small and focused commits but don't always code that way. I've got a code section to the effect of if abc: def etc I edited def and etc, and the hunk in magit shows both as ...
1
vote
1answer
35 views

Is there a way to selectively stash in Magit without indexing?

Is there a way to stash changes in magit selectively, akin to: git stash save -p <paths>
1
vote
1answer
141 views

How to use emacsclient in terminal to switch git branches?

I'm trying to make a setup that will use emacs as a command line tool to switch git branches. The idea is to run some command in terminal, something like emacsclient -t -e "(magit-checkout)". This ...
0
votes
1answer
45 views

Magit - remove confirmation when popping stash

Is there a way to remove a confirmation when popping a stash? Documentation say nothing about popping the stash. It says however that when dropping more than one stash, it has the confirmation by ...
2
votes
1answer
178 views

Magit log, limit to files, and completion can be very slow for large repositories

Doing magit-status, magit-log-popup, and =f to limit to files will try to help by building up a list of paths for completion. However, with moderately large repositories, which have a path like ssh://...