Questions tagged [magit]

is an Emacs extension for the Git version control system.

Filter by
Sorted by
Tagged with
5
votes
1answer
246 views

Output to magit-process

When I run built-in magit commands, they output to the magit-process buffer. How can I do the same with a custom magit command that generates shell output?
5
votes
1answer
131 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 ...
5
votes
1answer
196 views

How to hide the username in magit-log?

Trying to utilize a small screen, and I did this once before, so I know it's possible. How to hide the username in magit-log so that only the commit message is visible?
5
votes
3answers
983 views

How to change green background in magit running in xterm

I am running emacs in xterm with 'emacs -nw'. When examining diffs I find it hard to read text typed in yellow foreground and green background. How do I change it to eg. green/black or green/default ...
5
votes
1answer
2k 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 ...
5
votes
1answer
161 views

Key binding help for magit popup-based commands

Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is ...
5
votes
1answer
2k views

Configure Magit user name and email

Windows has an environment variable HOME which is on a remote serve (say Y:/, set by administrator and suppose not to be changed) and I start Emacs on my local disk, say C:/. (Emacs becomes slow if I ...
5
votes
1answer
99 views

Hide or fold stash section automatically in magit-status

I tend to stash a lot when using git, so my "stash" section in magit-stashes is getting pretty long. I'm not running out of hard-drive space or anything, so I don't want to delete the stashes. Can I ...
5
votes
1answer
866 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 ...
5
votes
1answer
558 views

magit tries to create new repository when I do magit-status in a repository

I recently updated magit from melpa. It seems that it requires Emacs 24.4. Since I had 24.3, I've also updated Emacs to 24.5. When I do M-x magit-status and choose the directory with .git, it asks me ...
5
votes
1answer
121 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 ...
5
votes
1answer
212 views

Notify about upstream git repo changes?

I have a repo for my dotfiles and update it here and there on various computers. Sometimes I forget to git pull before editting and git push. This creates conflicts or trigger git merge, or I just ...
4
votes
2answers
725 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 ...
4
votes
2answers
2k views

Magit git diff between two specific SHAs

Using git cli I would execute git diff SHA#1 SHA#2 How does one do the equivalent in magit?
4
votes
1answer
2k views

what's the difference between “revert commits” and “revert change” in magit?

In the magit from spacemacs, when I press O on a commit, it shows several actions, two of them are "revert commit" and "revert change", what's the difference between them?
4
votes
1answer
1k views

Magit equivalent of `git branch -D -r origin/feature/someLabelHere`

On the command-line, I often do this git branch -D -r origin/feature/someLabelHere to remove a remote branch after a pull request from that branch has been merged into master. I know now to do git ...
4
votes
2answers
2k views

Magit how to cancel running git process

In Magit, how can I cancel a git process that is taking too long? If I did something like git push from a terminal, I could press control-C to cancel. How can I do this from Magit?
4
votes
1answer
3k 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 ...
4
votes
1answer
919 views

how to discard a change in magit from spacemacs

In a normal emacs (not spacemacs), discard change is bound to key of "k", then in spacemacs, base on the following information. http://spacemacs.org/doc/DOCUMENTATION.html On the other hand, ...
4
votes
1answer
965 views

Set default branch (or revision) to diff against, in magit

I frequently diff against the "master" branch, and would like it to be easier in magit. Right now, I can do one of these: y, then scroll to master, then hit d d RET. l l, then scroll to the commit, ...
4
votes
2answers
717 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-...
4
votes
1answer
786 views

How do I visit a file on a different branch?

I'm aware of C-x v ~ which allows you to see a different revision of the current file, but I would like to visit the file on another branch. Is this possible with magit, VC or git-timemachine?
4
votes
1answer
607 views

Magit: Auto-refresh “magit-status”

Windows 10, Emacs 25.1, Magit I want auto refresh buffer "magit-status" when was some change on files in my project. So I set variable magit-refresh-status-buffer to on non nil. But it not help.
4
votes
2answers
452 views

How to follow commit hashes in commit messages?

Some commit messages contain sha1 hashes of older commits in order to reference these commits, e.g.: Fixes: deadbeef Is it possible to visit the referenced commit from the first commit message?
4
votes
2answers
2k views

How can I compare two commit diffs in magit?

I want to directly compare the diffs of two commits in emacs (rather than seeing the diff of two trees at given commit points). A bonus would be being able to use ediff mode to compare the two ...
4
votes
1answer
485 views

How to create a new branch from old commit using magit

When viewing the commit log, can I select a commit and checkout that commit as the head of a new branch?
4
votes
1answer
801 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 ...
4
votes
2answers
2k views

How to setup upstream remote using Magit?

I am reading through the magit manual trying to figure out how to configure remote variables. From the magit manual "7.1.1 The Remote Popup" on https://magit.vc/manual/magit/The-Remote-Popup.html : ...
4
votes
3answers
581 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-...
4
votes
1answer
168 views

What happened to magit-remote-update in version 2.1

The previous version of Magit had a remote update command to replicate git remote update What is the replacement command?
4
votes
1answer
260 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 ...
4
votes
1answer
175 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 ...
4
votes
1answer
391 views

Magit commit mode does not open anything to edit with

I recently installed Magit and began running it. It appears to load just find and all keybindings seem to work perfectly. However, when I intend to commit changes, magit doesn't seem to open my ...
4
votes
1answer
97 views

Configure upstream for rebasing onto master in magit

I have a forked repository. I want to configure my upstream so that I can keep my master up to date and rebase my feature branches. How can I do this? magit-version returns Magit 20160810.653, Git 2....
4
votes
1answer
226 views

Version control information out of sync with certain modes

Sometimes, though seemingly not in a consistent way, some modes that use version control information do not get updated correctly after git commands are run (e.g.,diff-hl-mode or git-gutter-mode ...
4
votes
1answer
453 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 ...
4
votes
2answers
2k 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 ...
4
votes
1answer
123 views

Can I move lines when committing parts of a hunk in magit?

I prefer to have small and focused commits but don't always code that way. I've got a code section to the effect of if abc: def etc I edited def and etc, and the hunk in magit shows both as ...
4
votes
1answer
300 views

Magit show status on selected directory

I have a git repo and I have changes in different directories. user@box:~/myrepo$ git st On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git ...
4
votes
1answer
188 views

Magit appends '^M' (return) characters to git results

In the magit-status window Magit shows '^M" for many things. This is on FreeBSD, which should be using newlines instead: This is, I think, the reason the push doesn't work right. From the magit-...
4
votes
1answer
1k views

How to checkout a specific commit inside magit?

Inside the magic log history, I could see lots of commits, and I want to rollback to the specific commit, how to do that? I could move to that commit, use "d" could see the different/change of that ...
4
votes
2answers
2k views

Magit - How to drop all stashes at once?

I have created quite a few stashes and I wanted to drop all of them at once. From terminal I could have done git stash clear I couldn't find a way to do it from magit. I tried selecting all ...
4
votes
1answer
103 views

Can magit pull hunks from another commit into my branch?

I have a big commit on another git branch. I'd like to "cherry-pick" some hunks from that commit into my current branch. I bet magit can do that, but I'm not sure how. Anyone? (I've seen ways to ...
4
votes
2answers
569 views

Using auth-source with magit and bitbucket

The code base I'm working on has recently moved from ssh key controlled git to https bitbucket. I use Magit to handle my version control in Emacs. In the old ssh world I was never challenged for my ...
4
votes
1answer
593 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 ...
4
votes
1answer
423 views

How can I stage all changes and commit them without displaying commit-message-buffer in Magit?

I am trying to write a function which stages all modified files and commits them. Staging is easy - just run magit-stage-modified. Committing is not - I couldn't find a way of creating a commit ...
4
votes
1answer
572 views

Is there a way to merge two branches interactively line by line in magit

How can I merge two branches with magit interactively line by line. Important there is no conflict (well ONLY for git it isn't) but I still want to do this.
4
votes
2answers
736 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:
4
votes
1answer
400 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....
4
votes
1answer
278 views

In Magit, what are good workflows for the two remotes?

As a longtime git user, I'm familiar with the following workflow for collaborative projects: My private repository is where I make local changes. My public repository is where I push changes that I ...

1 2
3
4 5
11