Questions tagged [magit]
is an Emacs extension for the Git version control system.
692
questions
0
votes
0
answers
38
views
Magit doesn't show diff highlighting until hunk is active
I recently started encountering a new issue, and I'm not sure why. When opening a Magit status buffer, the diff highlighting doesn't appear until I select a hunk, in which case it appears for just ...
1
vote
2
answers
207
views
How can I configure magit to use `diff-so-fancy`, not `magit-delta`?
How can I use diff-so-fancy in magit rather than magit-delta?
I'd like to refine diff buffer in Emacs with magit.
I found diff-so-fancy and prefer it to delta for several reasons.
I installed diff-so-...
0
votes
1
answer
42
views
Magit `zz` (stash both) does not allow whitespace in minibuffer
Sometimes when using command zz (stash both), the minibuffer to enter a stash message does not allow me to enter whitespace (e.g. space chars). I typically resolve to use dashes or underscores or even ...
0
votes
1
answer
36
views
How to get Magit to show popup when launched
I am getting used to learning Magit and I am having to launch the pop-up every time I use Magit so I was wondering if there is a way to have it do that by default instead of after I hit C-c C-c?
I ...
0
votes
1
answer
29
views
Magit commit gives "transient-setup: Wrong type argument: integer-or-marker-p, nil" message
I apologize if this is a noob-question, I have little experience with Git. I wanted to set up Magit for my projects, and I followed the "Getting Started" section of the Magit manual by ...
0
votes
1
answer
26
views
How can I use 'transients' in 'magit' to enable case-insensitive search? [closed]
I got it working a year ago, then my machine died. I've been unable to figure out the interface to transient.
When I view the levels (green and red, with numbers in them), I hit '-i' but see an error '...
7
votes
1
answer
1k
views
DOOM Emacs: Error running hook "global-git-commit-mode" because: (void-variable transient-base-map)
Full error (on the bottom line): Error (doom-first-file-hook): Error running hook "global-git-commit-mode" because: (void-variable transient-base-map)
Hello! I'm running this on an M1 chip ...
1
vote
2
answers
46
views
In magit, I want to (easily) see how a piece of code changes over time with commits
I'm curious if there's an easy way in Magit to see how a piece of code changes over time, i.e., with each commit.
I'd like to have one window open in Emacs, focusing on the code/function I want to see ...
0
votes
1
answer
24
views
Why while being in a local branch can't I pull into a local branch from another local branch with no potential for merge conflict? "No match"
See the picture below:
I am in a branch called 430-toggle-hide-show-colums (in green).
This is a local branch pushed to GitHub as P.R. draft (not yet merged).
Accidentally, I ended up doing ...
0
votes
1
answer
54
views
Why can't I solve this merge conflict on Magit?
I am working on a feature via Pull Request. While I was working, main branch evolved.
Now, I want to put my changes on the Pull Request on top of latest main branch. This means I want to rebase.
Hence,...
5
votes
2
answers
189
views
How can I prevent Magit-status command from grabbing the frame focus?
when executing magit-status and quickly focus out emacs, after the magit buffer pops up, emacs grabs the focus back. This is quite inconvenient. Is there a way to prevent that focus changing?
The ...
1
vote
1
answer
105
views
Undo stage hunk in magit
If I accidentally staged a hunk that I wanted a better look at, how do I undo that action (the most recent action). C-/ does not work.
Sure I can U to unstage all, but say all else staged is valid.
0
votes
1
answer
63
views
How to checkout a Pull Request locally using Magit interface?
Suppose someone (not me) submitted a Pull Request on GitHub.
Locally, I would like to run that work. Hence, I need to have the code locally. Following this documentation, I can achieve that in the ...
0
votes
1
answer
48
views
Magit aborts commit that runs with husky precommit hook but the commit works on the command line
I'm a bit a bit stumped by an annoying problem that I'm having with magit. I'm working in a monorepo (lerna) repository that uses husky to run a precommit hook. The hook runs on packages that have ...
1
vote
1
answer
102
views
Cannot invoke transient magit-pull while minibuffer is active
I'm using magit. When I try to pull or commit, I get this message in the mini-buffer:
Cannot invoke transient magit-pull while minibuffer is active
I can assure you, I have closed every magit-related ...
57
votes
5
answers
15k
views
Change a branch's upstream with Magit
When you push a branch with Magit (with P P) and the branch has no
upstream, Magit asks you the name of the branch you want to push to.
That's great.
Once you set the upstream for a branch, however, ...
3
votes
1
answer
106
views
How to see only the local branches created by me on Magit?
When I am working on the Command Line Interface, I can do:
$ git branch
Then, I can see all the local branches that I have created. On Magit, If I do b l (check out local branch), there is a prompt ...
0
votes
0
answers
9
views
if: Blaming failed due to unexpected output:
Linux Ubuntu 20
Emacs 28.1
I want to create magit-reset-soft
I try but get error:
if: Blaming failed due to unexpected output:
Here steps:
0
votes
1
answer
36
views
How to disable magit-revision buffer from following the cursor in blame buffers?
Open a file in a git repo that is modified by two commits. Run magit-blame.
*author1 date1 commit1*
line1
*author2 date2 commit2*
line 2
Focus on the first line, press Enter. A magit-revision ...
0
votes
0
answers
16
views
Debug Magit ssh authentication failure over TRAMP
I am using TRAMP to interact with files on a remote Raspberry Pi device from my MacBook.
When I SSH into the remote device with the CLI, git is able to find the associated SSH keys and pull/push from ...
2
votes
1
answer
278
views
How to disable magit on remote files with tramp?
I'm working with Emacs on windows, I usually work locally, but I want to disable magit when I'm working on a remote file.
I'm trying to add a hook that disables magit when it detects that the file is ...
0
votes
0
answers
22
views
Getting Magit to Show Word Count Diff
I'm aware that by setting
(setq magit-diff-refine-hunk 'all)
we can get magit to show the words added/changed:
Question: Is there a way to force the display the total number of words added, total ...
0
votes
1
answer
98
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 -...
39
votes
3
answers
6k
views
How to stash individual files with magit
git is capable of stashing of individual hunks.
With --patch, you can interactively select hunks from the diff between HEAD and the working tree to be stashed. The stash entry is constructed such ...
0
votes
0
answers
26
views
How to hide tag in `magit-log`
Please see the screenshot of my magit-log-branches:
I encounter some projects has lots of tags on each commits, and this situation cause each lines in magit-log tooooooooooooooo long and the magit-...
0
votes
0
answers
50
views
MAGIT: How to show 2 side-by-side window of only changes, not whole document
Once in the Magit buffer, hit E, choose the diff and when they're displayed then switch to vertical mode with |.
So far so good.
However, this shows three panes, not two.
How to show just current and ...
1
vote
1
answer
51
views
In Magit, how can I quickly diff changes in the current file since my last own commit?
When collaborating with others, I often need to check what others have changed in a file since I last worked on it. Is there an easy way in magit to do this? I.e. show the diff between my last own ...
4
votes
3
answers
173
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?
0
votes
1
answer
512
views
How to use authinfo credentials with Magit to push/pull to Overleaf
Overleaf allows git for some users. I have been using emacs and magit with overleaf since some time by providing username-password at each git push or git pull.
What I want
Now I want to configure ...
1
vote
3
answers
401
views
Corrupt Git configuration in magit
I updated My macOS to Monterey. After that, magit command yields "Corrupt Git configuration". I uninstall emacs and magit and install them again, but it does not resolve. How do I fix that?
0
votes
1
answer
19
views
How to change the commit associated to a tag on a branch that has already been pushed to GitHub?
I have attributed a tag called origin/v0.4.9 for a specific commit on a GitHub Pull Request. I thought the PR was simple, stable, and "a certainty" to be merged really fast. I was wrong.
I ...
0
votes
1
answer
21
views
When a merge-conflict happens and two options are shown, what is the magit command that allows the user to easily pick one of them?
Suppose a merge conflict happens. There are two options shown the upper (in red) and the lower (in green):
I would like to avoid complex ediff-mode stuff to pick one. I have seen some tutorial where ...
20
votes
5
answers
2k
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 ...
10
votes
3
answers
1k
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
1
answer
25
views
Toggle visibility of unchanged files in magit-status
I want to rename a number of tracked but unchanged files via magit. I know that I can use R (magit-file-rename). However, magit-status does not show me unchanged files.
How can I toggle the visibility ...
3
votes
2
answers
238
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 ...
0
votes
0
answers
16
views
MAGIT: log: finding expressions in committed files and showing lines containing it, not just commit list
I tried to find how to do this unsuccessfully:
When using the search option in MAGIT (l l -G) to search changes, the result is a list of commits that contain such expression. Is there a way to show ...
1
vote
1
answer
31
views
Let `magit-insert-local-branches` sort branches according to the branch.sort configuration
Is it possible to configure magit to sort branches inserted with magit-insert-local-branches into the main status page according to some criteria, for example whatever is configured as branch.sort in ...
2
votes
2
answers
42
views
When I do `magit-process-buffer` (`$`) it shows an ellipsis (`…`). What is behind the `ellipsis`?
I wanted to investigate the difference between magit-branch-and-checkout (b c) and magit-branch-spinoff (b s), so I invoked the Magit output buffer with $. I see the following output:
0 git … ...
1
vote
1
answer
34
views
Can I tell magit to show untracked files with a repo .git/config that tells it not to?
In my repo's .git/config I have status.showUntrackedFiles set to no (for performance, because it's a very large repo).
However, sometimes (e.g. before I push to remote) I'd like to manually check, ...
0
votes
0
answers
80
views
Magit cannot commit. emacsclient on PATH. Pop! OS
magit-status sees the repo just fine, and I can even push to Github, or make a branch. I can also commit through the git cli no problem.
However, before I can even write my commit message on magit I ...
1
vote
0
answers
14
views
Insert a magit-section without refreshing the buffer
I'm experimenting with magit-section as the UI library for an Emacs package. Without going into too much detail, this package interfaces with a websocket and displays the data it receives as an ...
0
votes
1
answer
28
views
In Magit, is it possible to know when an unstaged change happened? How to find that information?
I have a repository under version control and I am using Magit as an interface to git.
I can see one unstaged change in a file after executing magit-status (C-x g). This means the file was changed and ...
1
vote
0
answers
20
views
Can the Magit Forge issue list filter by assignee? Or display assignees?
I'd like to get Magit Forge to show me just the issues that are assigned to me. Or else display the assignees. How can this be done?
0
votes
0
answers
20
views
Switching to magit-status buffer doesn't update default-directory
I have two opened magit-status buffers for two different repositories. Switching to one of them, and for example listing history (l l) all works. However, switching to the second magit-status buffer ...
0
votes
2
answers
175
views
Warning assigning variables
I'm rebuilding my emacs configuration, and trying to compile without warnings. I'm using also cask. I have this case:
(require 'magit)
;; Enable a right limit of 70 chars for git logs
(add-hook '...
3
votes
1
answer
65
views
Context-aware username (e.g., git username instead of login name) in time-stamp
I am a total emacs/elisp newbie and I can't figure out how to do this.
I have time-stamp-active t with a pretty standard format: time-stamp-format "Last modified %Y-%02m-%02d %02H:%02M:%02S ...
2
votes
0
answers
22
views
pressing enter in the magit "git log", can the commit be shown in the full height of the screen instead of a half screen?
When I press RET in the magit "git log", can the commit be shown in the full height of the screen instead of a half screen?
RET runs the command magit-show-commit (found in
magit-commit-...
1
vote
1
answer
135
views
Load right version of Git while connecting to remote
I am currently working on a remote using Lmod for handling modules. I want to use Magit with the repositories on this remote, but the default system version of Git is 1.x.
However, Git 2.18 is ...
0
votes
1
answer
27
views
How can I activate truncate-lines in magit only
I want to long commit messages to be truncated rather than wrapped around in magit buffers only because I can simply open a commit to see the full message.
I tried
(add-hook 'magit-mode-hook (lambda ()...