Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
3
votes
2answers
463 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 ...
3
votes
1answer
259 views

Does magit when using ediff have a means for moving on the next file when there are multiple files to be diffed?

I am using ediff to get side by side diffs with magit and there seems to be no way to move to the next pair of files, after diffing the current file. For instance if I use vimdiff for git diff, after ...
3
votes
1answer
240 views

How to improve autoloading of Magit's git-commit-mode and other minor modes

Aim I would like to arrange for Magit's minor mode git-commit-mode to be enabled whenever a relevant Git file (e.g. COMMIT_EDITMSG) is visited, from both within Emacs (e.g. magit-commit) and without (...
3
votes
2answers
2k views

Magit how to use ssh key rather than being prompted for password

I've seen the question here but I'm not sure if the same solution would apply to me https://emacs.stackexchange.com/questions /17866/magit-how-to-use-systems-ssh-agent-and-dont-ask-for-password/17890#...
3
votes
1answer
138 views

What is the correct way to launch a long-running shell command from magit?

In response to a question about extending magit's push menu, I have successfully added a command that logs into a remote server, pulls from where I am, and runs make: (defun magit-update-course-repo (...
3
votes
2answers
91 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
257 views

Org-src-fontify-natively makes Magit think there are unsaved files

I've got a weird one for you. When all of the following are true: I'm using org-mode My org-mode file has a code block I export the org file org-src-fontify-natively is true Then I get a leftover ...
3
votes
2answers
724 views

Git commit uses fundamental mode after magit update

I recently updated magit to 20151025.1115, which gave me a message about git-commit-mode incompatibility. I now, instead, have a package git-commit at version 20151022.933 (from the magit project) ...
3
votes
1answer
120 views

How can I rename a tag in Magit?

Magit allows renaming various Git references. I can't see how to rename a tag with Magit commands.
3
votes
1answer
68 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 ...
3
votes
1answer
106 views

Running diff in Magit, filtered to only some specific files

I’m basically trying to run this command, but in Magit: git diff master..17 -- "**/*.scala" … i.e. to view changes in all *.scala files between ref/heads/master and ref/heads/17. I’ve tried setting ...
3
votes
1answer
96 views

In Magit log buffer, is there key bindings for traversing in a branch?

In a log buffer with multiple branches (using the lL command, with any =o option), a commit and its immediate parent or child may be shown far apart on the view and is difficult to trace back and ...
3
votes
1answer
194 views

highlight-chars and magit is conflicting

first time StackExchange user here. I'm having trouble with highlight-chars (probably font-lock) and magit. Enabling hc-toggle-highlight-* functions will remove the coloring from magit buffers. ...
3
votes
1answer
636 views

Seeing “Unpushed commits” after doing a push on the current commit

I understand that Magit will report a commit as "Unpushed" immediately after pushing it because it has not been pushed to the Upstream branch (master in this case). That makes me wonder what the ...
3
votes
1answer
914 views

Magit show git hook output

I'd like to configure magit so that when I decide to commit my changes I'm shown not only the buffer to edit commit message and the diff of changes but also the magit-process buffer. Is there a way of ...
3
votes
1answer
485 views

Magit: magit-merge-squash

When I was researching the best way to merge a feature branch with a lot of WIP commits I came across squashing and rebasing however when looking how to do this in magit I found this sentence in the ...
3
votes
0answers
86 views

How do I get magit to run: git push origin HEAD:refs/for/master ? (gerrit) [duplicate]

Gerrit has a magical reference (refs/for/master) that when you push to submits your commit to the code review system. I haven't been able to figure out how to get magit to push to this. I'm not sure ...
2
votes
1answer
2k views

How to use magit-list-repositories?

I have set magit-repositories-directorylike this (setq magit-repository-directories `("~/go/src/github.com/cescoferraro", user-emacs-directory)) Then I can M-x magit-list-repositories RET and I ...
2
votes
2answers
300 views

Pushing with P P does not work for me

Reading the Magit user manual, there is an entry on pushing the current branch to its upstream branch, by pressing P P. This is not working for me, as I get P isn't bound to any action on the second P ...
2
votes
2answers
424 views

How to make magit use --force-with-lease as default when pushing?

As per Magit's visual walkthrough, it is possible to save some configs as defaults, e.g: for diffing (section "Changing diff arguments"). I went through the documentation, but did not find anything ...
2
votes
3answers
557 views

how to supply universal-argument (C-u) to a function call inside a binding statement [duplicate]

I have this on my init.el ;; magit status (define-key evil-motion-state-map "gs" 'magit-status) But I would like to have another binding, for C-u M-x magit-status (C-u is the universal-argument) ...
2
votes
2answers
1k views

Disable evil-mode in magit

I am newbie here, need some help. After upgrade magit to v2.1.0 this morning, i found some short keys are different from the early version. What bothers me is this: when I use some short key(for ...
2
votes
1answer
117 views

Magit stage modified without confirmation

(magit-stage-modified 'all) stages all modified files, but only after confirming it with the user with the message Stage all changes? (y or n). The function is defined as follows: (defun magit-stage-...
2
votes
2answers
229 views

Automatically run ispell on magit COMMIT_MSG buffer

I make lots of spelling errors when constructing my commit message. It would be cool if I could add a hook to magit such that when I execute C-c C-c, it would run ispell before completing the commit ...
2
votes
2answers
887 views

magit with modeline status dot

I am using magit (2.2.2) with emacs 25. magit is very good BUT I want the status dot in the modeline (like psvn does). I try to use https://github.com/tsgates/git-emacs/blob/master/git-modeline.el ...
2
votes
1answer
70 views

(void-function closure) with Magit

I have Magit installed and it used to work fine. However of late, I am running into the following error when I run magit-status. Turning on magit-auto-revert-mode...done run-hooks: Symbol’s function ...
2
votes
2answers
448 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
3k views

Magit - How do I sync my feature branch with the latest master without checking out master?

Here's what I am trying to do:: I have one project in one git repository. I've made some changes in master and created a spinoff branch (b s) called my-feature. Now I've finished my feature and would ...
2
votes
1answer
299 views

How to execute emacs commands in background

When executing some time consuming commands like magit-status or using scp to transfer files, then Emacs freezes and waits for return. Is there any way I can tell Emacs to run those commands in the ...
2
votes
1answer
559 views

Remove key binding in magit-status-mode

I have C-RET set to other-window globally. For modes that would override this I manually add a hook to the mode's key map, e.g. (add-hook 'magit-log-mode-hook (lambda () (local-unset-key (kbd "<C-...
2
votes
1answer
685 views

How to commit a single staged file in magit?

When I type c-c (type c twice) in staged files, it will commit all the staged files, however i only want to commit a single file of the staged files. How to do it? Thx.
2
votes
1answer
206 views

Why isn't magit-version available?

I have Git 2.5.3 installed and am using GNU Emacs 24.4.1 on Ubuntu. I just installed Magit from MELPA: (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (...
2
votes
1answer
955 views

How do I clean up my local commits and rebase to upstream master in magit?

I have forked the interleave package. I made certain commits in my fork but now I want to discard them. I added the remote upstream branch (master branch by the interleave author), fetched it and ...
2
votes
2answers
722 views

How do I prevent magit from asking to set upstream while pushing?

When I want to push to a different upstream than origin, I use P C-u C-u P so I can set the upstream of the command, however magit always prompts me with question to set upstream also. How do I ...
2
votes
1answer
217 views

How can I turn off magit's warning that a commit message has a second line that is non empty?

Every time I have a second line in a commit message, magit prompts/warns me when commiting... Is there a way I can turn this off warning? I've found the following in the docs https://magit.vc/manual/...
2
votes
1answer
87 views

Proper way to provide a default optional parameter

I like doing PR reviews with Magit's diff, thus calling magit-diff-visit-file pretty often, providing a universal argument for the optional other-window parameter. To optimize the process instead of ...
2
votes
1answer
612 views

view git diff version by version

I'd like to browse the history of a specific file version by version. Ideally, as I step through history I should compare it with the closest previous version.
2
votes
2answers
367 views

Add (copy) to kill ring current branch name with Magit

Is there a way to easily copy the current branch name in Magit via M-x? At the moment I open the status pop up magit-status and copy the name from there. Best & thanks for your help!
2
votes
1answer
388 views

Disable C-Tab in magit mode

I use C-Tab and C-Shift-Tab to navigate buffer as I would do in a browser. Unfortunately, in magit-mode (which I call using magit-status), the key is bound to some diff expansion. The means that I can'...
2
votes
1answer
413 views

How do I make Magit only show diff for unstaged changes?

The default git behavior is to show only unstaged changes (ignoring stuff that I have staged/git added). How do I do that in Magit?
2
votes
1answer
52 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 ...
2
votes
1answer
69 views

Magit set upstream to origin/master automatically

Is there a way to set the upstream of a branch automatically in magit? I know I can select it interactively but for feature branches I set it to master 99% of the times so I was wondering if it can ...
2
votes
1answer
40 views

Prevent magit-status from closing hunk preview window when magit-status buffer close

I configured magit-status to open selected buffer change hunk in other window rather then in the same window with: (setq magit-display-file-buffer-function (lambda (buffer) (setq ...
2
votes
1answer
66 views

View file diffs in merge commits

When I open the commit view for a regular commit in magit, I can see the diff for each file. When I open a merge commit, I can only see a summary of the number of lines that were changed. Is there a ...
2
votes
1answer
2k 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 ...
2
votes
1answer
292 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. ...
2
votes
1answer
48 views

Latest Magit expands hunks after staging

With the latest version of Magit (20180410.432) I feel that the staging behavior has somewhat changed. Before, I used to expand the unstaged files in the Status Buffer, then stage the hunks one by one....
2
votes
1answer
506 views

How can Magit add a credential to ssh-agent?

Can I make Magit add my ssh passphrase to ssh-agent instead ask me to use the passphrase a single time? Every time I push a commit to my remote I need to type my passphrase or instead run M-& ssh-...
2
votes
1answer
424 views

Magit: amend the last commit with sign off

What if I forget to sign-off my last commit, how can I fix the last commit within Magit? I can do that with git command: $ git commit --signoff --amend Of cause I can write the sign-off by hand in ...
2
votes
2answers
99 views

Could magit be writing `.git/index` without my intervention?

I'm trying to track down an issue which might be caused by magit. I work on multiple machines, and on each machine I have an emacs running, each of which has some magit buffers open. I keep machines ...

1
3 4
5
6 7
11