Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
0
votes
1answer
33 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
26 views

Magit not correct work with Emacs 27.2 - duplicate text

Linux Mint 20 Emacs 27.2 Magit - 20210430.404 I create text file And now I want to stage and commit this file my magit. magit-status To stage I press S But I get error: Error running timer 'auto-...
0
votes
0answers
38 views

Duplicate headllines in org mode in CentOS

CentOS 7 Emacs 27.1 Magit Here my folder with org mode files: I open current.to.do.org and it success open. As you can see the first headline is ANDROID and last headline is TESTING. Nice. Now I ...
2
votes
1answer
2k views

Error (use-package): Failed to install magit: Package `magit-' is unavailable

I am starting to build up a .emacs file to be used as a development environment within Docker containers. I get this error when starting emacs-nox in a Docker container. Error (use-package): Failed to ...
1
vote
1answer
36 views

How to copy commit hash from Magit status buffer?

After I open a Magit status buffer and make a commit, I commonly also want to copy that commit's hash (the shortened version) to my clipboard to post somewhere else. I can't work out how this should ...
0
votes
1answer
12 views

Complete in-progress merge with the --no-verify option

Often when I'm merge the upstream branch into my branch I'll need to fix up some merge conflicts. At that point I have an in-progress merge. When I fix the conflict and hit m to complete the merge ...
0
votes
1answer
81 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 -...
0
votes
1answer
41 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 ...
0
votes
0answers
14 views

magit status buffer disappears

Magit status used to create a buffer with the buffer name magit: repo name. I recently upgraded Spacemacs and the Magit status buffer started to disappear whenever its window was not visible, and it ...
1
vote
1answer
144 views

How to use Magit to git log / git grep to find expressions across all previous commits

I am using Magit and was wondering how to revert to a specific commit that contained a specific expression. First I need to find the expression across all commits content. How to do this? In command ...
1
vote
1answer
58 views

magit equivalent to `git push -u origin newLocalBranch`

I often create new branches locally (e.g., newLocalBranch), and then push them to the upstream remote origin, thus creating a new remote branch, using git push -u origin newLocalBranch. Is there a ...
6
votes
2answers
1k views

Magit asks for passphrase for ssh key every time

Running emacs 25.2.2 magit 2.12.1 on Kubuntu 18.04. I have set-up ssh keys for my bitbucket repository and I run ssh-agent on start. When I fetch or pull or push, magit asks for the passphrase for ...
0
votes
0answers
24 views

Remove stale buffers after switching to a different branch

This is the scenario: Switch to a new git branch Open some "new files" in that branch Switch back to an older branch that doesn't have these "new files" I want these opened ...
0
votes
0answers
11 views

How to show full diff when using `Limit to files` in log?

When showing the log, there is an option to limit the log to commits touching a set of files. The log itself is fine, but when I open any commit on the log, the diff of that commit is limited to the ...
1
vote
1answer
63 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
0answers
42 views

Can magit truncate to 50/72 lines?

A common git style rule says that commit messages should be at most 50 characters long and commit descriptions at most 72. Can magit truncate the lines in the COMMIT_EDITMSG buffer in accordance with ...
3
votes
1answer
50 views

Magit status section with recent checkouts / visited branches?

In the same fashion magit can offer the list of recent commits in a section of status buffer. I'd like to have a list of recent checkout/visited branches to be able to quickly switch to it (M-xbb). ...
3
votes
2answers
725 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
86 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
0answers
33 views

How to take line from recent commit with Magit

Use Magit to view the log with show diffs (-p). Inspect 4 commit old commit. Navigate to a few lines I've since deleted, but want back my project. I can mark the lines but cannot copy them, which ...
1
vote
1answer
199 views

Magit help popup enabled by default

Every time I open Magit status buffer I need to press ?. How can I make it so it opens automatically? doing this didn't help (add-hook 'magit-mode 'magit-dispatch-popup)
0
votes
1answer
158 views

Deleting remote branches using Magit

I want to delete a remote branch. How can I do git push origin --delete my-branch in magit, to delete a remote branch?
1
vote
2answers
73 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/...
0
votes
0answers
18 views

Smerge: clearer refine mode?

I'm using doom+magit to deal with git, and I have smerge configured to change in-file conflicts. When I enable the smerge refine mode to highligh changes on a per-word basis, I find that refines works ...
0
votes
0answers
18 views

Smerge: auto-resolve LaTeX-like git conflicts

I'm using doom emacs + magit, and it enables smerge for me to display nicely my conflicts. I just saw that smerge has a function smerge-resolve to automatically resolve conflicts. I'd like to use it ...
19
votes
2answers
7k views

Magit - How can I checkout a remote branch locally without typing the entire branch name?

I have a remote branch remote-branch-long-name. When I magit checkout with helm completion I can type remote-branch and origin/remote-branch-long-name will show up as an option. The issue is that to ...
1
vote
1answer
72 views

finding git conflict in the same buffer if cursor is at end of the buffer

I am using next-conflict to detect is there any git conflict, using following answer: Jump to next merge conflict in project using Magit and Smerge. I experience that if I am at the end of the file/...
0
votes
1answer
25 views

Pull from git before applying org-capture?

I'm using org-capture to take project-specific notes by having a notes file in each of several git repositories. Looking forward, however, I can see danger here: if I'm working on project (1) and I ...
2
votes
2answers
538 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 ...
1
vote
1answer
59 views

What's the difference between magit-branch-checkout and magit-branch-and-checkout?

If I'm on the commandline, and I'm in the master branch, and I want to create a new branch and immediately start working on it, I'd just do git checkout -b foo. So I'm looking for the magit equivalent ...
0
votes
0answers
161 views

Getting the TAB key to work the same in Doom as in Spacemacs

When using the TAB key in a magit status/overview buffer, it says: Buffer is read-only. If I manually disable read-only mode, the pressing TAB indents the text instead of expanding or contracting ...
6
votes
1answer
923 views

Is there a way for magit to display the branch in the dired buffer mode line for a given directory?

I'm moving to emacs from shell/Vim and I'm very used to seeing the branch I'm working in when I'm at the project level. Is there any way to get the Git branch name to display in the dired buffer mode ...
1
vote
1answer
47 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-...
0
votes
1answer
83 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
1answer
38 views

MAGIT: “precomposed unicode is not supported”

I am trying to commit in my Emacs folde, and I get this message below: "precomposed unicode is not supported". I have run on my Terminal "git config core.precomposeunicode false" ...
1
vote
1answer
105 views

How to checkout a specific commit using Magit?

When using M-x magit-checkout, I can only select a branch. Is it possible to visit a commit (the stage at the commit) using Magit? Thanks!
1
vote
0answers
22 views

APIs to create a custom issue list on Magit Forge?

Using Magit Forge, I'd like to organize a list of open issues by assignee. Ideally I'd like to display them in groups by assignee, but I'd settle for a single list if the assignee were added to the ...
5
votes
2answers
680 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
24 views

Bindings just for text buffers created by magit?

I'm trying to create a different keybinding to abort a commit in magit. Right now, when you're editing a commit message C-c C-k is bound to with-editor-cancel, which does the trick. But I'm an evil ...
4
votes
2answers
3k 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 Magit, how to use system's ssh agent and don't ask for password I'm on Emacs 25.1 / Ubuntu 16.04. I've just ...
3
votes
1answer
2k views

How to use magit-list-repositories?

I have set magit-repositories-directory like this: (setq magit-repository-directories `("~/go/src/github.com/cescoferraro" ,user-emacs-directory)) Then I can M-x magit-list-...
0
votes
0answers
30 views

How to git stage a just-tangled file in `org-babel-post-tangle-hook`

I want to create a org-babel-post-tangle-hook that does a git stage buffer-file-name. There is a boring technical issue I have, which is that I don't know how to call magit-stage-file from elisp so ...
0
votes
1answer
52 views

Why magit use rectangle on origin/master and not only on master?

I have done a branch checkout on master but magit rectangle is on origin/master and not only on master.
2
votes
1answer
68 views

Magit connecting to github with alternate ssh key

I have two github accounts – one personal and one for my job. In most of my repos, I use my work account and magit works fine. In a couple personal repos, I have this in .git/config: sshCommand = ssh -...
2
votes
1answer
36 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 ...
0
votes
0answers
18 views

Local magit revives all stale tramp connections

I'm using long-living emacs sessions using emacs in daemon mode, and I use tramp quite extensively. I usually have several buffers in the background which use tramp, but since my system has been ...
4
votes
1answer
292 views

Displaying branch descriptions in magit

The release notes for magit 2.1.0 state "Branch descriptions can now be displayed in the refs or status buffer". However, I can't find these features documented in the info pages. I am using magit ...
0
votes
0answers
8 views

How to remove all labels from a topic in forge

How can I remove all labels from an issue or PR in forge? When I trigger the edit-label minibuffer and clear its contents, then hit enter, the labels are not removed. I can see that forge is first ...
0
votes
0answers
26 views

Closing magit's visit-file/blob window doesn't return focus back to magit

If Magit's log is open and you hit RET on any of the commits, it opens a visit file/blob window where you can see the diff with some details. There's a few ways to do it, but I believe in Doom Emacs ...
0
votes
0answers
43 views

How to reset/undo changes in folder using Magit

I'm looking for a way to undo changes in selected directory, analogue of git checkout [folder-path] in Magit. I found that I can reset changes of specific file to selected branch by typing X f in ...

1
2 3 4 5
12