Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
6
votes
1answer
248 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
154 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
50 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
95 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
35 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
122 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
69 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
33 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
184 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
34 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
39 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
180 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 ...
3
votes
1answer
504 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
128 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
65 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 ...
5
votes
1answer
155 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
22 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
73 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
48 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
942 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
82 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
55 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
72 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
114 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
108 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
37 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
326 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
69 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
33 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
132 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
44 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
160 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
43 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
110 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
93 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
179 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
392 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 ...
2
votes
2answers
315 views

How can I open magit-status in a new frame?

How can I open magit-status in a new frame? I've tried to write a custom function for this but it has some issues as described below. (spacemacs/set-leader-keys "gs" (lambda () (interactive) ...
0
votes
1answer
133 views

Create and checkout to new branch by one command

If I need to create new branch and checkout to it I use two commands: 1.magit-branch 2.magit-branch-checkout Is it possible by one command to create AND checkout to new branch?
0
votes
1answer
40 views

How do I get better indication that my git configuration is wrong?

I ran magit-status, and was surprised by the absence of changes. It turned out that I'd misconfigured my git textconv settings, so 'git diff' was returning an error. However, I saw no indication of ...
1
vote
1answer
327 views

How do I visit a file on a different branch?

I'm aware of C-x v ~ which allows you to see a different revision of the current file, but I would like to visit the file on another branch. Is this possible with magit, VC or git-timemachine?
1
vote
1answer
269 views

Search through logs by author/comitter name in magit log buffer

Once I enter into the logs for a repo from the status buffer (using ll) how do I search through the log buffer by username? Just using regular isearch doesn't seem to pick up the author names in the ...
1
vote
1answer
183 views

how make “magit log” show entire log message

I have a commit with a message like this: Contact Inquiries todo: current user detection import old table actionmailer + mailgun Magit log only shows "Contact Inquiries", and not the other 4 lines. ...
1
vote
2answers
209 views

Jump to next merge conflict in project using Magit and Smerge

When I am resolving merge conflicts with Magit and Smerge, is there a way for me to cycle through all merge conflicts in the project? Currently I can only move through them one file at a time. I ...
2
votes
1answer
43 views

Is it possible to disable magit calling :git branch --remote --contains <foo> when doing an interactive re-base?

I'm running on fairly large repository (Gentoo's portage, 2.5G .git) and slightly slow hardware (1Ghz arm64) and interactive re-basing is very slow. It seems the main culprit is "git branch --remote --...
0
votes
1answer
118 views

make-magit-popup-event: Symbol’s function definition is void: record [SOLVED]

I get the above message using the latest magit from melpa. This occurs with GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-12-20 on Ubuntu 16.04. Any ideas?
0
votes
1answer
97 views

Signing merge commit with magit

I know how to sign standard commits using magit, but I'm not able to sign the commits generated by merges. Is there any way to do that?
2
votes
1answer
44 views

How can I log the commands magit uses for values?

I'm bringing up a new machine and some operations are very slow. I'd like to re-run the commands magit is sending in a normal shell so I can use perf to see where time is being spent. magit-git-debug ...
0
votes
2answers
216 views

commit by saving and then killing the COMMIT_EDITMSG buffer in magit?

I understand that in magit the normal way to commit after editing the commit message buffer would be C-c C-c However in using git from the command line --- with Emacs as the editor for commit ...
1
vote
1answer
199 views

How to save remote repo credentials

Linux Mint Emacs 25.1 Remote repo URL origin (h t t p://git.remotehostname.git) In application SmartGit when I pull/push data from remote repo, it's prompt credentials ONLY ONCE. But when I try ...