Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

Initializing forge-alist

I am trying to initialize Magit Forge's forge-alist programatically. Therefore I put together my first couple of emacs-lisp code. It looks like the following: (let ((gitlab-install (lambda (host) (...
0
votes
0answers
26 views

Magit continues despite pre-commit hook failing

I have a pre-commit hook in git that returns nonzero on some "fatal" QA checks. When using git commit on the command line, git bails out. However, when trying the very same commit in Magit, ...
1
vote
1answer
47 views

How to create an annotated tag with an empty message in Magit?

Objective Create an annotated tag with an empty message, as would be created with the following command. $ git tag --annotate epic-tag --message="" Attempts Create it with M-x magit-tag<...
1
vote
1answer
47 views

Can magit stage a hunk / selected lines in 'diff-mode'?

Is it possible to stage the current hunk or selected lines of the hunk in diff-mode? For example, when in diff-mode, what command can I run to stage the current hunk?
0
votes
1answer
28 views

How to apply a hunk of changes in diff to current branch?

I have two branches, let's say branch a and b, I would like to apply some changes from b to a. Note that I use magit-diff to show the differences between the two branches. Then I would like to apply ...
1
vote
0answers
15 views

Is it possible to apply `smerge-keep-mine` for all the conflicts by using a single keybinding?

I am using smerge to resolve conflicts in order to apply merge. I am applying one by one for smerge-keep-mine to all conflicts, which I belive equivalent for git merge --strategy-option ours [Q] Is it ...
52
votes
2answers
7k 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 ...
0
votes
1answer
31 views

Magit: cannot commit error, unsure why

I am getting the error below and I have no clue what could be causing this. Any help is greatly appreciated: 1 git --no-pager --literal-pathspecs -c core.preloadindex\=true -c log.showSignature\=...
1
vote
1answer
36 views

How to keep magit from prompting me for my GitHub username

I'd like to configure magit so that it does not prompt me for my GitHub username when it needs to interact with GitHub in some way (like, say, when doing a push). My GitHub username is already in the ...
0
votes
2answers
151 views

magit-status open selected buffer change hunk in other window rather then in the same window

I used to have this functionality using code below: (setq magit-display-file-buffer-function (lambda (buffer) (setq current-prefix-arg t) (magit-display-file-buffer-traditional ...
0
votes
0answers
20 views

Magit git commit isn't working on spacemacs

After installing Magit in spacemacs. I used Helm to create a git repository. I added some files to stage then tried to commit. Let me know if I'm doing something wrong or it's just an issue. I get: ...
0
votes
0answers
13 views

Force magit to ask for confirmation before deleting a branch

I would like to have magit ask for confirmation when I've told it to delete a particular branch. Currently it seems that magit considers the selection of a branch to delete to be the confirmation, as ...
0
votes
0answers
25 views

magit, understand magit-blame

When I enter magit-blame it shows the following lines. jihae 2020-04-07 14:51 불필요한 파일 삭제, yarn 빠진 부분 추가, public path Eugene Kim 2020-06-04 17:50 config process.env.__DEV__ = ...
2
votes
1answer
41 views

Is there a way to see a pull-request review status in magit?

I see I can view the github pull requests assigned to me with forge-list-requested-reviews. Is there a way to see the status of each review? For example I've approved some of the pull requests that ...
0
votes
1answer
38 views

Magit remove local branches that were merged into another branch

Explaining the problem more in-depth than the titular definition: Often I merge branches into master and want to prune based on that. M-p works fantastic for removing the remote branches (eg origin/...
1
vote
1answer
28 views

How to set smerge-command-prefix to “\C-cv”

I find the default prefix for smerge-mode C-c^ and I have following setup: (setq smerge-command-prefix "\C-cv") (setq smerge-command-prefix "\C-c\C-v") Also C-c ^ runs the command ...
0
votes
1answer
23 views

Git commit multiple files

When I go to commit my changes VC seems only allows me to commit one file at a time via C-x v v. Is there a way for VC to commit more than 1 file at a time?
1
vote
2answers
310 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
49 views

How to change the default transient level temporarily? (“Show hidden magit commands”)

Many commands that are rarely used in magit are hidden by default. Magit uses the transient.el library for popups and the visibility of infix and suffix commands are controlled by transient-default-...
1
vote
1answer
39 views

Magit configuration file location on Mac

I want to reset Magit defults for particular pop up that was previously saved using magit-popup-save-default-arguments (https://magit.vc/manual/magit-popup.html). Where is the file created by magit-...
1
vote
2answers
47 views

How can I create a new label using Magit forge?

Using Magit Forge, I'd like to create a new label for a new issue. I can edit the Labels field using command forge-edit-topic-labels, but that command accepts only labels that already exist. How can ...
4
votes
2answers
479 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?
0
votes
0answers
112 views

Syntax highlighting for comments in Magit commit buffers with custom core.commentChar

I frequently source the body of my GitHub PRs from my commits, and thus is makes sense to consider my commits to be made in Markdown (it is nice to have a markup language for commits anyway). Thus I ...
1
vote
1answer
85 views

Extra carriage-return on magit path

I'm having a little trouble with magit and the default-directory variable. When calling M-x magit-status, an exception is thrown - Setting current directory: No such file or directory, /path/to/git/...
0
votes
1answer
66 views

Unable to push into Github using Magit

When I try to push into my remote repository, the mini buffer says Running git push -v origin master:refs/heads/master but nothing else happens. Following the manual, I have staged, committed, and ...
1
vote
2answers
86 views

Debugger entered--Lisp error: (wrong-type-argument sequencep all) cl-intersection((all magit) all)

I am trying to use magit-delta (https://github.com/dandavison/magit-delta). I am using GNU Emacs 26.3. When I add following line ( (magit-delta-mode 1) )into the .emacs file, I get following error: ...
3
votes
2answers
539 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 ...
17
votes
4answers
2k 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-...
0
votes
2answers
44 views

magit status and git lfs files diff shows pointer diff

When I call magit-status git lfs files are shown as follows. modified src/myfile @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:...
0
votes
1answer
74 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 -...
4
votes
1answer
149 views

How to set magit recent commit always expand when i open magit status?

When I open a Magit status buffer, then the recent commit section is closed, I need to use TAB to expand it. How can I configure it to always be expanded.
0
votes
1answer
45 views

How do I stop magit popups on commit?

When I do a commit, magit popups the diff in a separate wm window. I'd like it to show the diff in the same wm window and just split into a different wm window. I've tried this answer, but it hasn't ...
0
votes
1answer
38 views

Magit forge: updating the branch of a pull request

Does forge support updating the branch of a PR? Suppose that I checked out a PR branch with b y, and afterwards there were additional commits into this PR. It seems that I cannot pull these new ...
1
vote
1answer
38 views

git-blame with spacemacs

I'm trying invoke magit-blame in spacemacs. If I do: SPC g b Then I see a "git-blame" section at the bottom which says: Press [_b_] again to blame further in the history, [_q_] to go up or ...
0
votes
1answer
16 views

Reverting a hunk without refreshing in Magit Diff

Typing v in Magit Diff mode causes an often slow and uncecessary refresh. Can this be avoided? For example when looking at a diff between a range of commits (say origin/mater...HEAD). Typing v (A.K.A. ...
0
votes
1answer
29 views

Magit Move Submodule

In git bash I can use git mv home/subdir_1/my_submod home/subdir_2/my_submod to move a submodule between directories. Git handles changing .gitmodules and stages the change to be committed. Is there a ...
0
votes
1answer
48 views

Error in newly installed magit -head branch header wrong type argument

I just installed the magit package in emacs 26.3 (using CentOS 7 OS). When I start it with M-x magit, I get the error below. It works fine for me in an older installation, and the only difference I ...
3
votes
2answers
98 views

Show recently used branches

In git I run this command to show recently used branches: git for-each-ref --sort=-committerdate --count=10 refs/heads How do I do this in magit?
3
votes
1answer
59 views

Is there a way to mark certain file types as binary for magit, so that they are not diffed?

Magit sometimes becomes very slow, when it thinks that certain large files should be diffed. Examples for this are SVG graphics or SQL dumps (technically seen as text files). The files are small ...
40
votes
3answers
5k views

Magit split hunk into two hunks

There's a question on SO about splitting hunks using magit, and the two solutions given are to either stage the region (mark a region, hit stage), or to shrink/grow all hunks using + & -. That's ...
2
votes
1answer
64 views

Magit deprecates `magit-popup`. Which of my packages depend on it?

How do I get Emacs to report which packages in my running Emacs depend on magit-popup? Soon Magit will stop supporting magit-popup because it has transitioned to the replacement transient. Somehow ...
0
votes
1answer
27 views

In magit, the log '-s' option shows ESCAPE characters instead of changing the color of the selected text

Here is an example of a copy of the output of the magit log output with -s with the actual names omitted. (The ESC character precedes each of the [31 and [32 sequences in the following example in the ...
0
votes
1answer
59 views

Is it possible to force `markdown-mode` during git commit?

I was using following answer: https://emacs.stackexchange.com/a/57535/18414 to set markdown on the .git/COMMIT_EDITMSG file. (add-to-list 'auto-mode-alist '("/\\.git/COMMIT_EDITMSG\\'...
3
votes
1answer
135 views

Cannot get Magit to show the commit signatures in the log

In order to prove that I had a signature on a commit I needed to use a this command line command: $ git log --show-signature -1 I could not get Magit to display the signature I tried to use the ...
0
votes
1answer
22 views

Deleted package doesn't reappear in the package list

I just deleted magit, but it doesn't reappear in the list as available. I typed g and r, restarted emacs, to no effect. It's not hidden. I use C-s to search for it in the buffer. Supposedly its ...
0
votes
1answer
37 views

Magit error on magit-remote-add

On windows 7 version of spacemacs, with git layer, magit fails when trying to add a remote repository. After I enter the remote name, I get the following error: Debugger entered--Lisp error: (wrong-...
0
votes
1answer
34 views

How to stage selected lines / hunks in diff-mode?

Is it possible to stage changes in diff-mode? Or is this only possible with magit+ediff?
3
votes
2answers
646 views

How can I open magit-status in a new frame if such a frame does not already exist?

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) ...
6
votes
1answer
232 views

Use `git add -N` in magit

Wondering if it's possible to indicate intent to add a file via magit. The intention would be to stage parts of an untracked file for a commit but leave the rest, rather than the default git add ...
1
vote
1answer
19 views

See untracked file content

I would like to see the content of the untracked files, so I could see what's there and possibly stage only some lines. I have status.showUntrackedFiles = all, so in magit I can see the files inside a ...

1
2 3 4 5
12