Stack Exchange Network

Stack Exchange network consists of 175 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
65 views

Use magit to display the difference between two branches

Is there a way to bring up a big list of the differences between specific commits across two branches? I tried the method described in this answer but it came back empty, I assume because the ...
1
vote
1answer
26 views

Package to help display status of each git repo contained in a common directory

I have a directory and in the directory is a rather long list of git repositories. Is there a package or options where a dired listing of the directory would also add in the status of each git repo ...
0
votes
1answer
48 views

How to integrate Emacs + Lab + Magit

I'd like to use lab hub wrapper for handling mr/issues of my own custom gitlab server. When I open a pull-request using hub (github) it's works fine the git-commit-mode from magit, syntax highlight ...
1
vote
2answers
120 views

How to customize a magit popup, conditionally on the state of the repository?

In response to a question about adding an action to magit's push menu, I've written an Emacs Lisp command to implement the extension, and I've learned that I can extend the push menu by calling magit-...
5
votes
2answers
161 views

How to extend magit's context-sensitive push menu?

I'm using git to maintain a web site located on a remote server. My workflow has been as follows: Stage and commit changes to the web site (can do with Magit) ssh to the remote site and pull the ...
0
votes
0answers
21 views

Run a function before/after magit runs git

I'd like to run a function before magit runs git, and another one after magit runs git. I see magit-pre-start-git-hook but I don't see any post-finish-git hook. How can I run commands before and after ...
1
vote
1answer
37 views

Mode-line not updated after checking out new branch using Magit

I create and checkout a new local branch via magit. Pressing M-x magit-status then b c for branch create and in the magit buffer I see the new name of the branch that I am apparently on. However ...
0
votes
0answers
16 views

magit options when dealing with a failed git-am

I'm not sure if I'm missing something or if this is a missing feature but occasionally when I attempt to apply a patch from my mail box git completely fails to apply it. This isn't a case of ...
1
vote
1answer
143 views

Magit - Always show expanded sections by default

Sometimes (seemingly randomly) the sections such as "Recent commits", will be closed by default. Can I set it so they are all always open by default?
4
votes
3answers
276 views

Why does magit now prompt for which submodule to update?

I used to be able to press "o" then "u" (magit-submodule-update) in a magit buffer and have it update all my submodules. Now, it asks me to type in the path of which submodule I want to update. Is ...
0
votes
0answers
29 views

How to ask magit to use external diff and merge tools?

I have set the git variables [merge] and [diff] to the appropriate values like this: [merge] keepBackup = false; tool = p4merge [mergetool] prompt = false [mergetool "p4merge"] cmd = ...
1
vote
2answers
128 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 ...
5
votes
2answers
80 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 ...
0
votes
2answers
57 views

How to create a new repository on Github from Magit

I am unable to add a remote repo to github if it does not already exist on github. E.g. magit-init Add some files, stage and commit. Then magit-remote-add --> Remote name:github --> Remote url: ...
1
vote
0answers
54 views

Magit throws error when I press “h” or “c” [on hold]

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
70 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
63 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 ...
2
votes
2answers
1k views

How can I do a git diff on the current file?

I'd like to do a diff on the current file / buffer compared to the git repository. Ideally a single function that could be called, or binded to a keyboard shortcut.
2
votes
1answer
45 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 ...
7
votes
3answers
335 views

Magit: Copy text from Stage section without character “+”

Windows 10, Emacs 25.1, Magit I select some text (Shift + Arrow Down) from the Unstaged changes section. Here is a screenshot: Then I paste into another buffer (*scratch*). This is the result: Is ...
2
votes
1answer
291 views

Magit commit is slow even for tiny changes

For the last few months, committing even tiny changes using magit (c c) is really slow to bring up the commit message buffer. I've profiled the code that is executing during that time but I'm not ...
2
votes
2answers
88 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
2answers
62 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 ...
2
votes
1answer
56 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 ...
-1
votes
1answer
35 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 ...
1
vote
1answer
39 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
40 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 ...
7
votes
2answers
681 views

Magit + gerrit - push to other branch

I am using gerrit. When I want to push my commits, I use following command: git push origin HEAD:refs/for/master How can I recreate the same command using Magit?
0
votes
1answer
28 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
41 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 ...
1
vote
2answers
244 views

use nonstandard `.git` directory with magit

I have been using the setup described on the top comment here to manage my dotfiles using git. In short, I have this in my .bashrc: alias config='/usr/bin/env git --git-dir=$HOME/.myconf/ --work-...
0
votes
1answer
126 views

Magit pushing through tramp does not work

Hi guys I'm on a osx machine and I want to push commits from a remote machine through tramp to github. I open the directory in dired on the remote machine which works fine and type M-x magit status ...
0
votes
1answer
35 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
1answer
138 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
122 views

Modify last commit's message and push to upstream

I'm thinking about automating my following git workflow in emacs: checkout to a new branch remove some pattern in the last commit message commit (amend) it push it to upstream How could I automate 4 ...
3
votes
2answers
42 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
31 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 ...
2
votes
1answer
61 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: ...
0
votes
1answer
69 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 ...
1
vote
2answers
58 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>...
6
votes
3answers
180 views

A way to insert a predefined text into Magit's commit message window?

We have a convention that every commit message begins with an issue number. I'd like to be able to programmatically insert the issue number part (computed by a separate function) into the commit ...
1
vote
1answer
550 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
48 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
41 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
218 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
133 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
2answers
514 views

magit: GitError! Could not read from remote repository. [Type `$' for details]

For some repositories at work I get the following message when I try to push my commits: GitError! Could not read from remote repository. [Type `$' for details] The details read: 128 C:/Program ...
0
votes
2answers
685 views

Magit commit error: “cannot spawn sh” + “cannot start editor”

When I try to commit using Magit, I get the following error message: 1 c:/Users/chanyoungs/AppData/Local/GitHub/PortableGit_f02737a78695063deace08e96d5042710d3e32db/cmd/git.exe … "commit" "--" ...
2
votes
1answer
48 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....
0
votes
1answer
30 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.