Questions tagged [git]

is for Emacs support of Git, the distributed version control system. Emacs `version-control` feature supports many systems besides Git. Additional extensions, such as `Magit`, also provide extensive Git support. Therefore use additional tags besides `git` for Git related questions.

Filter by
Sorted by
Tagged with
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
835 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
406 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
831 views

How can I tell magit to ignore specific modified files?

I am working on a project where webpack's bundle.js is part of the repository. This file is gigantic and has many diffs and slows magit down. Is there a way I can tell magit to ignore this file when ...
4
votes
1answer
233 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
94 views

Disabling automatic add after resolving git conflict

After updating emacs (to 25.2.2 as shipping in ubuntu 18.04) I notice a change that completely breaks my conflict resolution flow in git. Once I resolve a conflict using emacs and save the file, emacs ...
4
votes
1answer
126 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
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
108 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
597 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
146 views

Open files in git repo that have been edited since a previous commit or branch

Is there a way to provide a list of files that have been edited since a previous commit or branch with helm and projectile integration? The use case is as follows: Create feature branch feat-my-...
4
votes
1answer
577 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
1answer
640 views

emacs prompting for github password

I've recently switched from spacemacs to radian and have suddenly run into magit prompting for my github password whenever I view the status of a repository (the repository is configured to use SSH). ...
4
votes
1answer
425 views

Show git branch in dired modeline

I would like to see the git branch shown in the dired mode-line at least for the top directory of git projects. Anyone done this or know how to?
4
votes
2answers
891 views

Using `emacsclient` as `git config core.editor` and invoking `git commit` as `shell-command` in Emacs?

I am trying to use Emacs 25.1.1 (graphical version, Windows 10) as both the primary editor and the editor for git operations. In my workflow, I invoke git through M-x shell-command. I tried the ...
3
votes
4answers
487 views

Set author per repository

I work on both work and personal projects on my machine, and for my work projects, I prefer to use my work email, and vice versa. In shell, I use direnv to set GIT_COMMITTER_EMAIL and ...
3
votes
1answer
702 views

How do you do “git checkout — .emacs” using magit?

When a file (like .emacs for example) is modified in a Git repository, if I want to git pull git refuses to do so because I have a modified file. Git proposes to remove the modification by doing git ...
3
votes
4answers
456 views

Predicate function to test if file is under version control?

What is the predicate function to determine if a given file is under version control? (I'm using git.)
3
votes
1answer
645 views

Function of org-clock-save.el file and Git related question

I'm asking this question because I'm personally confused on how org-clock works in general. My org-clock-save.el file only has one line, ;; org-persist.el - PCNAMEHERE at <2016-04-24 Sun 11:16&...
3
votes
1answer
210 views

How can I back up my init file with Git?

The docs say to keep the .emacs file in the HOME directory. I'd like to share the file between multiple computers using a git repo. What is the best way to structure the repo without including ...
3
votes
1answer
52 views

Exclude magit autosaves from git log --all?

I like the idea of (magit-wip-after-save-mode) but it makes git log --all (or la in Magit) very cluttered. Is there a simple way to exclude autosaves from all the autosave "branches"? On the command-...
3
votes
1answer
415 views

What is the Magit 2 way to do what wazzup used to?

I used to use Magit <2's wazzup mode to survey unmerged branches or general branch divergence. What's the right way to do that or some other way to view unmerged branches in Magit 2?
3
votes
1answer
59 views

Magit: Howto create a new commit ignoring white-space differences

I'm using magit 20191128.39 on Emacs 26.3 When changing a python script resulting in a new unstaged change, git/magit should ignore whitespace-differences. A git diff -w will do the trick, but I'd ...
3
votes
1answer
157 views

git rebase -x (“exec”) with Magit?

Is it possible to use the "exec" mechanism when rebasing with magit? From the git rebase man page: -x <cmd>, --exec <cmd> Append "exec <cmd>" after each line creating a ...
3
votes
1answer
214 views

Is there a way to view summaries of multiple repositories

I'm using a small script like for d in $HOME/Repository/* ; do if [[ -n "$(git -C $d status -s)" ]] ; then emacsclient --eval "(magit-status $d)" fi done to open repositories that ...
3
votes
1answer
124 views

Cannot get Magit to show the commit signatures in the log

In order to prove that I had a signature on a commit I needed to use a this command line command: $ git log --show-signature -1 I could not get Magit to display the signature I tried to use the ...
3
votes
2answers
487 views

How to configure git and magit to stream line making pull requests?

From the main repository on github, I created a fork on github and I keep the master branch of my fork up to date with the main repository by doing: git checkout master git pull upstream master git ...
3
votes
2answers
342 views

should I gitignore my elpa/gnupg directory?

I keep ~/.emacs.d/ under version control with git. I used to gitignore the elpa/ directory, but recently started including it in case I ever want to rollback a package upgrade. I just noticed an ...
3
votes
2answers
728 views

Git commit uses fundamental mode after magit update

I recently updated magit to 20151025.1115, which gave me a message about git-commit-mode incompatibility. I now, instead, have a package git-commit at version 20151022.933 (from the magit project) ...
3
votes
1answer
378 views

How do you hook up git to emerge through emacsclient?

I previously had the following script in a file called .emacs.d/emerge-for-git: #!/bin/sh emacs -Q $* And In my .gitconfig: [merge] tool = emerge [mergetool "emerge"] path = /home/rovanion/....
3
votes
1answer
931 views

Magit show git hook output

I'd like to configure magit so that when I decide to commit my changes I'm shown not only the buffer to edit commit message and the diff of changes but also the magit-process buffer. Is there a way of ...
3
votes
1answer
136 views

Get unique, permanant revision name in vc

I am writing some Elisp for a package. I was using vc-working-revision to identify the current revision. But it only returns the branch name, not the hash that name points to. Therefore, this ...
3
votes
1answer
155 views

Nested git repositories that behave like one project with projectile

I am trying to understand how to use https://projectile.readthedocs.io/en/latest/projects/#customizing-project-root-files but it is not clear yet. My goal is to have nested git projects. Let's say I ...
3
votes
1answer
505 views

Magit: magit-merge-squash

When I was researching the best way to merge a feature branch with a lot of WIP commits I came across squashing and rebasing however when looking how to do this in magit I found this sentence in the ...
3
votes
0answers
86 views

How do I get magit to run: git push origin HEAD:refs/for/master ? (gerrit) [duplicate]

Gerrit has a magical reference (refs/for/master) that when you push to submits your commit to the code review system. I haven't been able to figure out how to get magit to push to this. I'm not sure ...
3
votes
0answers
508 views

Emacs on Windows: `shell-command` hangs when process wants input

I am using Emacs on Windows 8. Some processes when run through shell-command will request interactive input, notably commands like git push (which will ask for user name and password). Sometimes I ...
2
votes
2answers
625 views

How to change options passed to git vc-annotate?

I have a hard time using vc-annotate (my version control system is git), because the output is not very userfriendly, as it displays long filenames in a separate column in the buffer, which take up ...
2
votes
2answers
895 views

magit with modeline status dot

I am using magit (2.2.2) with emacs 25. magit is very good BUT I want the status dot in the modeline (like psvn does). I try to use https://github.com/tsgates/git-emacs/blob/master/git-modeline.el ...
2
votes
1answer
3k views

Magit - How do I sync my feature branch with the latest master without checking out master?

Here's what I am trying to do:: I have one project in one git repository. I've made some changes in master and created a spinoff branch (b s) called my-feature. Now I've finished my feature and would ...
2
votes
1answer
698 views

Unable to use git in shell inside a buffer

I used 'M-x shell' to start a shell inside a buffer. Then I tried to run git diff After I press the space bar a few time, the lines 29-69/69 line is printed a few and the shell has stopped responding....
2
votes
1answer
956 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
1answer
56 views

How do I associate a file such as git's `COMMIT_EDITMSG` with a specific mode?

I was doing following solution for markdown files: How do I associate a file extension with a specific mode? (autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t) ...
2
votes
1answer
417 views

How do I make Magit only show diff for unstaged changes?

The default git behavior is to show only unstaged changes (ignoring stuff that I have staged/git added). How do I do that in Magit?
2
votes
2answers
2k views

magit-stash-create: Cannot save the current index state

I'm using magit 20160517.838, Emacs 25.0.50.2 I just upgraded magit from 20160320 to 20160517 and when I try to stash I now get this issue; magit-stash-create: Cannot save the current index state I ...
2
votes
1answer
50 views

Package to help display status of each git repo contained in a common directory

I have a directory and in the directory is a rather long list of git repositories. Is there a package or options where a dired listing of the directory would also add in the status of each git repo ...
2
votes
2answers
386 views

Elpy starts Python processes at the root of my git tree, not the module's actual location

(I now submitted this as an issue in GitHub: https://github.com/jorgenschaefer/elpy/issues/1249) I'm using Emacs 25.3.1, Elpy v20171212.850, and Python 3.6.3 on MacOS 10.13.2 . I have a project ...
2
votes
1answer
294 views

Magit diff working file to commit in log?

How does one ediff a current file--ie working tree--against an arbitrary version in some previous commit? In this case, I'm interested in pulling in some, but not all, changes from a commit in ...
2
votes
1answer
116 views

Does git-messenger support showing a commit using Magit?

In this issue in git-messenger's issue tracker it was suggested that it should optionally use magit-commit-mode to show commits in a separate buffer. And that issue was closed as resolved. But it ...
2
votes
2answers
118 views

VM causing magit not to work

I have this error when I start emacs: File error: Searching for program, no such file or directory, git My Git is inside the VM in /usr/bin/git How can I point emacs to it? I'm using tramp and ...