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.

0
votes
1answer
18 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 ...
0
votes
1answer
36 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
49 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
34 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
28 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 ...
1
vote
1answer
27 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
30 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
34 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?
1
vote
1answer
34 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
27 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
1answer
22 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
46 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
39 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
206 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
125 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
34 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
50 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
25 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
35 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
37 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
27 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
70 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
25 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
27 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
113 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 ...
1
vote
1answer
97 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
78 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
62 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 ...
4
votes
1answer
82 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
17 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
48 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
36 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
351 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
39 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
41 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 ...
2
votes
1answer
30 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
80 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
61 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 ...
2
votes
1answer
29 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-...
1
vote
1answer
141 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
53 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
29 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
79 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 ...
-1
votes
1answer
41 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
83 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://...
2
votes
1answer
38 views

Magit, an easy way to see if there is more than one line of comments in Magit-Status

To clarify I know about magit-revision i.e. spacebar but there doesn't seem to be a clear way to tell if a commit has more than one line of comments or not. What I'm talking about is this: be93ed0 ...
0
votes
2answers
70 views

Show a list of names for all git projects

Windows 10, Emacs 25.1, Helm, Magit I have many git projects in different folders. Is it possible to show list of names for all git projects in one buffer?
0
votes
1answer
45 views

how to add a default-on option of magit log

Since the 'log --graph' is slow in the repo with long history, I wanna add '--since' option for it. I tried to add the following lines in my '.spacemacs' file. (magit-define-popup-option 'magit-log-...
2
votes
1answer
77 views

Magit equivalent for “git branch | git branch -d”

I just learned about magit-remote-prune for cleaning up stale remote branch. For merged local branches, I often use git branch | git branch -d to clean up. Is there a way to do that in Magit; ...
10
votes
3answers
150 views

Magit: How to show differences within lines

I have a file, I make some changes. Here how SmartGit shows differences. As you can see it shows where the difference is within the line. It changes background to red color in concrete position. And ...