Questions tagged [magit]

Magit is an Emacs mode for interacting with Git.

Magit is an interface to the version control system Git, implemented as an Emacs extension.

Unlike the Version Control package which is part of Emacs and strives to provide a unified interface to various version control systems, Magit only supports Git and can therefore better take advantage of its native features.

With Magit, you can inspect and modify your Git repositories with Emacs. You can review and commit the changes you have made to the tracked files, for example, and you can browse the history of past changes. There is support for cherry picking, reverting, merging, rebasing, and other common Git operations.

Magit's maintainer prefers if questions are asked on the dedicated Emacs Stackexchange site instead of here.

168 questions
2
votes
1 answer

In magit, can I interactively rebase onto another branch?

I have a feature branch that I want to interactively rebase on master, like: A - B - C - D (master) \ E - F (feature) The desired result is A - B - C - D (master) - E - F (feature) with some sanity-check scripts running after E and F…
Jun Inoue
  • 544
  • 1
  • 4
  • 9
2
votes
1 answer

magit 2 equivalent of . command to mark commit

Many magit tutorials still online as of September 2015 (e.g. here, here, and here) are based on magit 1.x, and describe a diff workflow where the user marks a start commit with . and then moves point to the end commit and invokes diff with =. Using…
jbyler
  • 7,200
  • 3
  • 34
  • 42
2
votes
2 answers

How to see unmerged commits on emacs magit branch

So when I create and switch to a new non MASTER branch, I can no longer see the list of unpushed commits. I guess that makes sense, as I am on a branch and MASTER is now my upstream (instead of github)? Still, I would like to be able to see…
Stephen Cagle
  • 14,124
  • 16
  • 55
  • 86
2
votes
2 answers

see history of region in git

I wonder is there any way to see the history of a region in git, i.e. all the commits that touched some pieces of code (defined as several contiguous lines of code)? I think this is kind of cool. I am using magit, so any suggestions on how to use…
chtlp
  • 645
  • 1
  • 6
  • 16
2
votes
2 answers

how to use magit to edit diff from a commit

I have committed some changes and in the diff shows some things that they are not necessary. for example: position:relative; - background: whitesmoke; } + background: #f5f5f5; } So I want to erase this entries. Can I use magit to do…
b10n1k
  • 567
  • 5
  • 21
2
votes
2 answers

Why might the author date be stuck at an old date with git?

I track all my projects in git. Unfortunately, in my main repository the author date seems to be stuck. It reports as July 15, 12:25:08 -0500 for almost every commit since then. The commit date seems to be working correctly. There is evidence this…
Michael Johnson
  • 2,287
  • 16
  • 21
2
votes
2 answers

failed to push some refs to 'https://github.com/myname/myrepo'

question on magit / push I'm starting using magit, with very little experience in git. I've gone trough the magit manual with success for : adding ignoring staging commiting locally Then, I try to push on github.com/myname. For that, I use 'P P',…
JeanMichel
  • 93
  • 2
  • 5
2
votes
2 answers

Magit : how to see pre-commit hooks before editing commit log?

With git on the command line, you see the result of your pre-commit hooks before entering the commit's log message. If your pre-commit hook makes the commit fail, you are warnt and don't write anything. But with magit, you are asked to enter your…
Ehvince
  • 17,274
  • 7
  • 58
  • 79
2
votes
2 answers

How to run magit synchronously

(let ((default-directory "/home/vision/")) (magit-pull) (magit-fetch "upstream") (magit-merge "upstream/master") (magit-push)) I'm getting: Running git fetch upstream Git is already running How can I wait for fetch finish?
cnd
  • 32,616
  • 62
  • 183
  • 313
1
vote
1 answer

(Ma)git branches drive me crazy

Using Emacs/Magit, I had first a very smooth git experience in another project, but in my actual project I'm confused by all the branches and annoyed by the not tracked #file.ext# that pop up al the time. Here is how it looks: a4cc383 master…
Thorsten
  • 3,451
  • 3
  • 20
  • 25
1
vote
1 answer

How to toggle ingore whitespace in the magit revision buffer?

In the magit-log buffer when return key is pressed it brings up the magit-revison buffer displaying the diff b/w previous commit and the current commit. Is there a way to toggle the ignore-whitespace in this buffer?
Talespin_Kit
  • 20,830
  • 29
  • 89
  • 135
1
vote
1 answer

Magit what's the equivalent for `git checkout -b` command?

What I'm trying to do: I'm in develop branch and would like to create a new feature branch. In command line I usually just run git checkout -b new-feature-name. How can I do it using Magit shortcuts? Checkout branch/new branch/new spin-off/new…
BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
1
vote
1 answer

Magit select modules in status window

How do I select multiple modules in the magit status window so I can update them all at once? What is the magic key binding that tags/marks them for that operation (o u)?
Engineerist
  • 367
  • 2
  • 13
1
vote
1 answer

Git SSH to Github with a Config File Stuck in a Loop

SSH commits to Github do work with my current setup. I use this recommended script to trigger the password prompt: #!/bin/bash eval $(ssh-agent -s) ssh-add ~/.ssh/github_ssh_private_key However, ever since I switched to Emacs' Magit, password…
Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76
1
vote
1 answer

Magit: how to disable highlight in the selected diff hunk

I'm using emacs 27.2 and magit 20210406.454. When I show a diff on magit (i.g., on magit-diff) the selected whole hunk is highlighted. How can I disable it? For example, this is the screen capture when I show the diff on magit: It shows added lines…
Masa
  • 13
  • 3