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
2
votes
1answer
466 views

magit blame: how to go to the commit my cursor is currently on

I want to checkout the file as it was when before the commit was applied so I can dig deeper. Now I just resort to command line git to do that.
5
votes
1answer
451 views

How do I stop Emacs micro-stuttering and high CPU utilization caused by background calls to git?

Using Emacs on Windows, I experiences issues due to background invocations of git.exe. The same issues might apply on Linux, though the more light-weight process calling might make them unnoticable. ...
0
votes
1answer
108 views

View the log of the staged files while editing a git commit message

When I'm editing a Git commit message, I sometimes like to browse recent commits to the same file(s). That is, I'd like to view the output of git log $list_of_files_with_staged_changes. Git commit ...
0
votes
2answers
136 views

Is there a common way to open “svn-status” or “magit” depending on current buffers system?

before I sit down and reinvent the wheel for me: I'm working with svn and git in different projects. Is there already an existing way to start svn-status or magit, depending on the vcs that is used ...
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 ...
2
votes
1answer
257 views

How do you grep from within emacs ( git grep 'foo' | grep baa )

I do this often after shelling out to bash $ git grep 'banner-image' | grep mb3 Can I do it without leaving emacs?
2
votes
2answers
231 views

undo vc-annotate-revision-previous-to-line

When I've launched vc-annotate and then type a (vc-annotate-revision-previous-to-line), emacs will show me the revision before the one on the current line. From the docs: a Annotate the ...
1
vote
1answer
273 views

utf-8 characters with eshell, eshell-visual-subcommands, and git

Using the configuration (eval-after-load "em-term" '(progn (add-to-list 'eshell-visual-subcommands '("git" "diff" "help" "log" "show")) (add-to-list 'eshell-visual-options '("git" "--help"...
2
votes
1answer
719 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....
16
votes
1answer
6k views

Magit - Undo last commit - History Manipulation

This StackOverflow question has the best solutions/approaches to undo last commits. I started using Magit a couple a weeks ago and after looking through all its documentation I still don't have a ...
24
votes
1answer
2k views

Choose files to stage of a new directory with magit

If you create a new directory, its files won't show up with magit-status, only the new directory is in the list of Untracked items. Currently I have to magit-stage-item the new directory and then ...
0
votes
1answer
173 views

Magit fetch all repos from GitHub

I have just installed Magit and so far all is going great! However, I have a lot of GitHub repos that I would like to fetch via Magit. Is there a way to fetch all repos from GitHub?
1
vote
1answer
165 views

Insert and expand snippet when committing with Magit

I use a template with Git for keeping my commits messages neat and professional, as explained here. However, since I use Magit, I would like to insert and expand a snippet with Yasnippets because ...
1
vote
1answer
2k views

How to show git repo status info in mode-line

Here is my current custom, but I don't know how to customize its face. And it only shows branch name, no other status info. (setq-default mode-line-format (quote ((:eval (if vc-mode (...
2
votes
1answer
297 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
2answers
853 views

Turn on auto-fill-mode when editing a commit message with Magit?

I have tried: (add-hook 'git-commit-mode-hook '(lambda () (setq fill-column 72) (turn-on-auto-fill))) In both cases, auto-fill-...
2
votes
2answers
931 views

Magit - Unable to commit

Magit is unable to commit anything is giving the following message 1 c:/cygwin64/bin/git.exe … commit -- Waiting for Emacs... ERROR: Wrong type argument: arrayp, nilerror: There was a problem ...
5
votes
3answers
283 views

Package manager: which files not to add to git?

I'm keeping my config-files in a git repository to use it on multiple different machines. I'm using the emacs package manager, but I don't want to add the packages to git, because which packages have ...
0
votes
2answers
872 views

How to use OSX command line GUI emacs as git $EDITOR

I have a script to launch OSX GUI emacs from command line at: /usr/local/bin/emacs The script looks like: #!/bin/sh $(/Applications/Emacs.app/Contents/MacOS/Emacs --chdir $PWD "$@") & I have ...
0
votes
1answer
63 views

Is that possible to Emacs to respect .gitattributes and .hgeol?

Is that possible to Emacs to respect .gitattributes and .hgeol? I am again on Windows with Cygwin emacs-w32 and would like if Emacs honor project specific CR/LF settings for new files...
3
votes
1answer
650 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&...
51
votes
4answers
11k views

Add change to a previous commit with Magit

I have 2 commits, A then B, ready to be pushed. I realize I forgot to add something in A. How can I add this change to A using Magit? I don't even know which part of the Git documentation I should ...
1
vote
1answer
153 views

Why is the Projectile Git repository being set to the most recently cd'd directory?

When I run projectile-find-file in GUI (non-terminal) Emacs, the project directory is set to the directory I most recently cd'd to in a terminal window. Let's say that I have a home directory not ...
2
votes
2answers
630 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
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
119 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 ...
3
votes
4answers
457 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.)
15
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 ...
5
votes
3answers
1k views

Magit always use current branch to create new branch

I am currently on master branch and I have to create new branch called test starting from master. If I run b c in magit buffer, magit will prompt for starting point Create branch starting at (...
2
votes
1answer
118 views

Does magit support interactive git hook?

My git hook would prompt for answer yes/no when do the push. How could I get the prompt and enter my input when using Magit?
0
votes
1answer
298 views

magit - triangle workflow with branches in fork

I am using a triangle workflow. Upstream is called upstream and my forked repository is called fork. I want to have multiple branches and each of those branches should exist both locally as well as ...
7
votes
1answer
484 views

Magit: how remove push branch?

I want to remove the push branch for a repository. I only use merge branch to push to a remote repository and now I have two headers with the same info all the time: Head: master Merge pull ...
0
votes
2answers
356 views

Use remote git executable for magit and git-gutter when file system is SSHFS

How can I use a remote git executable for all git operations when accessing a file via SSHFS? I mount a remote system's git repo via SSHFS on my local computer. The git repo is medium-sized with ...
4
votes
1answer
147 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-...
1
vote
2answers
273 views

super detailed vc-change-log

When I do l (vc-print-log) in the *vc-dir* buffer, I get the *vc-change-log* buffer with a single line per commit. Even when I can hit RET (log-view-toggle-entry-display) there to get the details, I ...
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?
0
votes
1answer
132 views

How to remove git stashes when inside magit-status

Inside the magit-status, I see tons of stashes. Can I removed them by pressing a key on the keyboard?
3
votes
1answer
711 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 ...
0
votes
1answer
278 views

Can I exclude .git/COMMIT_EDITMSG from file-name-history?

Is there a way to exclude .git/COMMIT_EDITMSG files from file-name-history? Now that I'm authoring commits with Magit, those commit message files are often the most recent entries in file-name-history,...
4
votes
1answer
580 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.
51
votes
2answers
9k 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 ...
58
votes
1answer
7k 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?
3
votes
1answer
216 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 ...
0
votes
1answer
84 views

Open set of buffers based on git branch

I'm very new to emacs, but from what I understand it should be able to do almost anything. Something I have wanted in my IDE for a long time, is a bunch of open files, based on a git branch. I do dev ...
0
votes
1answer
145 views

Emacs build error when use “autogen.sh all” to generate configure for master branch

I just cloned the source and try to build Emacs under my debian Jessie, but has some problems: [23:31:04 coeus]$ ./autogen.sh all Checking whether you have the necessary tools... (Read INSTALL.REPO ...
5
votes
1answer
224 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 ...
2
votes
1answer
418 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?
4
votes
1answer
234 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 ...
1
vote
1answer
191 views

magit equivalent of gitk's “Diff this -> selected”

gitk has a feature where you select one commit, then right-click another and can choose to either "Diff this -> selected" or "Diff selected -> this". Is something like this possible in magit-log? ...
2
votes
2answers
194 views

Show change log of other branch with vc-git

When using VC for a Git repository on Emacs 24.3, I want to view commits in a different branch from the one I've checked out. It seems like C-u C-x v l should be command for that, as it asks Log from ...