Stack Exchange Network

Stack Exchange network consists of 174 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.

4
votes
1answer
868 views

Stage diff hunk into git from ediff?

How do you stage a hunk into git from ediff? I'd like to be able to view a side-by-side diff and stage hunks into the "HEAD" side of the diff, but that buffer (i.e., spacemacs.~master~) is read-only. ...
2
votes
2answers
857 views

customize-face magit-item-highlight properly

I have a problem with the magit-item-highlight in different themes. With monokai, zenburn, etc., the item highlight is a background, and does not interfere with green and red diff faces. However, with ...
10
votes
2answers
1k views

Is it possible to limit magit's log view to just commits from the current branch?

Currently when I bring up the local magit log ("l l") it takes a fair amount of time. It would be nice for the log just to limit itself to the nearest merge base (e.g. vs origin/master) but I haven't ...
32
votes
3answers
5k views

How to easily cherry pick with magit?

I've been using magit for a few months now and I like it a lot. But one thing I still do it in a terminal is cherry picking. What is a simple way to do this?
2
votes
1answer
887 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
667 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 ...
-1
votes
1answer
336 views

Magit fails to create local repository

This is what I got when I select a directory (whether it had a git repository) and choose "yes" when magit asks if I want to create one: Debugger entered--Lisp error: (wrong-type-argument stringp nil)...
0
votes
1answer
690 views

magit fails to install

I am unable to install magit with package.el. While other packages install correctly, magit (v 90150116) currently gives me: Debugger entered--Lisp error: (wrong-number-of-arguments #[(ad--addoit-...
1
vote
1answer
85 views

What is happening when my uncommitted changes temporarily disappear from magit?

More then once when I have been reviewing changes to be committed in magit, the pending changes have unexpectedly disappeared from the status buffer. I'm pretty sure it's because I am accidentally ...
44
votes
1answer
4k views

Can I checkout a given commit from magit's log view?

I'm exploring a git repository history using magit's log view using l l. Can I checkout a given commit from there without going to terminal?
7
votes
3answers
2k views

Get git repo root directory, preferably with magit

How can I get the root directory of the current git repo? I could run shell-command-to-string on something like git rev-parse --show-toplevel. Is there a better way? Does magit or any other git front-...
21
votes
3answers
9k views

Untrack file without deleting it?

I have a tracked file in a git repository. How do I untrack this file without deleting it using magit?
7
votes
2answers
733 views

Default commit comment for magit

Is there a simple way to have default text pre-populate in the comment buffer when commiting code with magit?
36
votes
2answers
6k views

How can I open a specific revision of a file with Magit?

Is it possible to open a specific revision of a file in Emacs with Magit without changing the current branch? I have rebased some local changes to a revision where the modified functions were ...
14
votes
2answers
2k views

How can I list available tags in Magit?

I would like to list the available tags in Magit in order to diff a specific revision, is this possible? Specifically what I am after is to list the revision history at a certain tag and then view ...
15
votes
2answers
1k views

Can Magit do git format-patch?

I just wanted to know if Magit has this functionality. The reference manual does not have this explicitly so that's why I am asking.
15
votes
1answer
1k views

How to access command switches in Magit

Most magit commands are invoked with a single key, which pops up a menu of subcommands and switches. For example, P shows P and t as subcommands and -f and -u as "switches." Hitting the letters for ...
25
votes
3answers
2k views

Magit split hunk into two hunks

There's a question on SO about splitting hunks using magit, and the two solutions given are to either stage the region (mark a region, hit stage), or to shrink/grow all hunks using + & -. That's ...
13
votes
2answers
1k views

Git: is it possible to stage a selected region directly from the file buffer?

With Magit you can open the magit status buffer, press TAB to expand the diff (or RET to bring up a separate diff buffer), mark parts of a hunk and press s or u to stage/unstage the region. Really ...
40
votes
4answers
9k 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, ...
1
vote
1answer
720 views

How to set magit remember git passphrase on Windows?

I run magit on Linux and it works very well. On Windows, it works almost the same except the push process: Git Bash would ask me to enter passphrase to continue, while magit just hangs. I set ssh-...
4
votes
2answers
623 views

Which version of magit am I installing?

Here is a snapshot of my list-package result related to magit: Question: There's nothing in my init.el on marmalade, why the package from marmalade are also listed? If I run M-xpackage-...
15
votes
3answers
501 views

Command to visit Github pull request of current branch with Magit

It's very common that, after pushing a given branch upstream, I'll want to visit it on github and create a pull request. I'm starting to get annoyed at having to manually visit the repo, find the ...
14
votes
2answers
2k views

How to checkout ours/theirs on a file in magit?

Let's say I have a merge conflict. I see a conflicted file like this: Unstaged changes: Unmerged Foo/bar/wibble/plop/elbow.txt I can hit tab here to open the changes and maybe jump to a point ...
13
votes
4answers
988 views

How can I make `--verbose` flag be enabled by default in magit commit screen?

Right now, instead of pressing just cc in magit-mode, I have to press c-vc every time to enable --verbose. Is it possible to make it enabled by default?
4
votes
2answers
559 views

How to make vc-* and magit treat a symbolic link to a real file in git repo just like the original file?

Say, I got ~/.emacs which is a soft link to ~/.emacs.d/init.el(using ln -s ~/.emacs.d/init.el ~/.emacs) which is in a git repo, because this will make it easier to reach init.el, outside or inside ...
8
votes
3answers
273 views

How to scroll up when expanding a section in magit-status?

In the magit-status buffer, pressing TAB shows or hides a given section, which is handy when looking at unstaged content and see what hunks can be staged. However, when tabbing on a section, the ...
7
votes
2answers
490 views

Can I have the git-log “--all” option be initially selected?

When I press the "l" key in the main Magit status mode, it pops up a window where I can adjust the options to be passed to the magit log command. Can I arrange for the --all option to always be ...
7
votes
1answer
724 views

How to make `truncate-lines` nil and `auto-fill-mode` off in magit buffers

I got (setq-default fill-column 80) (setq-default truncate-lines nil) ;; which is default When using magit in Emacs, I know that I should avoid long commit messages, but sometimes they just cannot ...
3
votes
2answers
564 views

How to get colors in Magit diffs on Windows?

Color codes are not working on my Windows 7 box. I have working colors in Git Bash that comes with the Git install. Here is what I get:
12
votes
2answers
2k views

How do I force a specific buffer to open in a new window?

When committing changes in Magit, it is useful to have the diff view open while adding details about the commit. In Magit, we see the diff in the *magit ..* buffer. When you hit cc while the cursor ...
3
votes
5answers
442 views

How to get a major mode to open full screen

I'd like magit to default to a large buffer instead of one that is half the size of the available space. Even better would be a way to wrap the call to a major mode to make this happen when opening ...
5
votes
2answers
376 views

What is the best way to reload git stashed changes you've popped while file is open in buffer?

When I'm viewing a file and then pop a stash which modifies that file in the working tree using git stash pop in either bash or eshell, what is the best way to immediately see those changes in the ...
13
votes
2answers
300 views

Magit pushing / pulling show progress

I'm missing some visual indication of the push / pull progress. After executing the appropriate command, magit prints Pushing to domain.tld:repo.git however, no further indication of the ...
4
votes
1answer
1k views

magit: how to set default username?

Is it possible to set a default username (i.e.: my Github user name) for magit? It is prompting for the user every time I have to push a commit. Don't know if this may help with the answer, but I ...
10
votes
8answers
947 views

magit-push hangs on Windows

I'm using GNU Emacs on Windows, and I am unable to use magit-push to push my local changes to a remote repository. This happens with remote repositories regardless of if they are accessed with SSH or ...
4
votes
1answer
2k views

Magit on Windows: “searching for program: permission denied, git”

I installed Magit on Windows, but every time I use it, it give me the error: searching for program: permission denied, git even though I already installed the git software on windows. (it seems ...