Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 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). ...
2
votes
1answer
76 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
17 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
151 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
53 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
12 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
12 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 ...
17
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
42 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 ...
3
votes
2answers
634 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
2answers
506 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
30 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
44 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
906 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
45 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
66 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
34 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
65 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
57 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
17 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 ...
4
votes
2answers
604 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
23 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 ...
3
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
18 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
37 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
49 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
35 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
16 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
285 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
7 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
25 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
30 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 ...
0
votes
1answer
34 views

Magit: rebase and push, basic questions

I was learning magit and found this screenshot at Command to visit Github pull request of current branch with Magit: I was wondering why we have Rebase and Push (and not just Push) at the top. What ...
0
votes
2answers
35 views

magit: squash commits in feature branch, but ability to unravel later if needed

Does magit offer a way to squash a bunch of commits, but preserve some sort of record of the micro commits - should you need to step through them the next day.
1
vote
1answer
75 views

What means Unmerged into origin/master in magit?

In the magit buffer I see Unmerged into origin/master, yet I'm not noticing see any issues while merging with magit or with git on the commandline. Searching for the the subject brought me here[0], ...
17
votes
2answers
7k views

Using magit for the most basic add, commit, push

I normally use only a few git commands each time I want to commit changes to a repository: $ git add --all . $ git commit -m "update." $ git push -u origin master Can magit be useful in this regard? ...
4
votes
2answers
508 views

How to delete ^M in the diffs of Magit?

I had an issue with a file that had inconsistent line ending. My file would show a ^M for every line ending. I ran into this article that shows how to get rid of the ^M character and set the buffer ...
1
vote
1answer
38 views

magit on Windows over plink tramp

I'm scratching my head on this problem, but I cannot seem to use magit on a project served over plink or plinkx on Windows. What does work: The windows client can use magit on a project stored ...
0
votes
1answer
25 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 ...
10
votes
7answers
2k views

How to Implement Popup Menu Similar to That Used in Magit

Question I would like to create user interface in form of popup menu, popup menu similar to that used in Magit. Features Definition of Popup Popup in context of this question means little ...
0
votes
0answers
71 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 ...
0
votes
0answers
36 views

writing a magit function that specifies the repo

I would like to write helper functions in elisp for putting dotfiles under version control using YADM. From their documentation I learned that I could call up the magit status buffer for the YADM ...
0
votes
1answer
23 views

Can't create new branch

I clone git project. Current branch is main. Nice. Now I want to create new branch: my-branch Magit Branch Read Upstream First: Value Menu read upstream first I try this: magit-branch-create Create ...
3
votes
1answer
148 views

Magit-todos warning: File is too long, consider excluding it from scans

Whenever I do something in Magit buffer I get this warning: Warning (magit-todos): File has lines too long for Emacs to search. Consider excluding it from scans: path/to/file In particular it ...
2
votes
0answers
51 views

How to deal with user arguments with magit transients?

I understand the infix flags work. However, I'm not sure how best to work with argument inputs. I have read the docs as well as looked at some examples from the magit source code but it's still a ...
0
votes
1answer
37 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
1answer
77 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
2 3 4 5
12