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
13
votes
2answers
13k views

How can I use emacs with git within the terminal?

I've used git config --global core.editor emacs to set my git editor as emacs but when I do that and commit something the editor opens up a new window instead of opening emacs within the terminal. I ...
1
vote
1answer
541 views

View for version control (git) status with full file names

Tools > Version control > Git > Status produces nice interactive output to browse the repository. Is there any way however to have full path names of the modified files, which can be textually copy-...
4
votes
1answer
228 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 ...
1
vote
1answer
242 views

Enable smerge-mode for already opened file

smerge-mode doesn't always get enabled for git merge conflicts. I think this happens when I visit a file using emacsclient which is already opened in a buffer. Something (maybe magit?) is causing the ...
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?
6
votes
1answer
151 views

Indicate whether file has uncommited changes in mode line

In my mode line I can see if a buffer has unsaved changes (**- or a red x in my case, since I am using smart-mode-line). Is there a similar way to display whether or not the file visited by the ...
4
votes
1answer
616 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.
3
votes
4answers
575 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
437 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?
2
votes
2answers
314 views

Git pull from/push to a specific branch with magit commands in elisp

When I run magit commands through the magit interface it runs those commands relative to the branch/repository I am currently visiting. However, I am trying to write some code in my config file that ...
1
vote
1answer
588 views

How to create a patch (git diff) with a specific name

I would like to create a patch (git diff) with custom name -- e.g., hello-world.diff. Emacs doesn't seem to be able to handle git diff > hello-world.diff, perhaps because of the greater-than sign ...
3
votes
4answers
505 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.)
0
votes
1answer
73 views

there is no info of author in git-timemachine

git-timemachine is good to use, but how to show author (committer) along side with the commit message?This information sometime is important for me
18
votes
3answers
5k views

Magit extremely slow in Windows. How do I optimize?

I am forced to use Windows 10 for a project. Yes, I would rather use GNU/Linux. To keep my sanity, I've tried to regard Windows as a bootloader for Emacs :) Unfortunately, Magit (one of my favorite ...
4
votes
1answer
273 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 ...
11
votes
1answer
6k views

How do I set the upstream branch to push a local branch to in magit?

From what I remember, if I am working on a branch, e.g., my-feature-branch, I used to be able to do this from the magit-status menu with P P, and then selecting the remote branch from a list which had ...
1
vote
1answer
788 views

Create a branch off of the merge-base of two branches in magit

At work, if I am working on a bug fix, I sometimes want to base my hotfix branch off of the merge-base of our master and develop branches, because the branch will eventually be merged into both of ...
5
votes
1answer
1k views

Delete multiple branches in using magit from `helm-mode-magit-branch-delete`

From the magit-status buffer, if I hit b k it will bring up a list of branches with helm-mode-magit-branch-delete. If I select a branch and hit RET, it will delete that branch (sometimes prompting to ...
17
votes
2answers
4k views

How to automatically sign commits with magit?

I'm interested on having each of my commits signed with my GPG key. Since I use magit for interfacing with git, I was wondering if telling magit to sign each commit was possible (or some workaround to ...
2
votes
2answers
210 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 ...
1
vote
1answer
960 views

Got “fatal: no tag message?” error when set git core.editor to “emacsclient -nc”

When I set the core.editor="emacsclient -nc", after I press "C-c C-c" in the .git/TAG_EDITMSG buffer, I got the error message: fatal: no tag message? But here is the content of .git/TAG_EDITMSG ...
3
votes
2answers
687 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 ...
3
votes
2answers
839 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) ...
1
vote
1answer
3k 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 (...
3
votes
1answer
1k 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 ...
102
votes
3answers
29k views

How to merge Git conflicts in Emacs

My recent Git merge has resulted in a large number of conflicts. My current approach is to search for the next occurence of '<<<' and then perform the merge by standard text editing. ...
2
votes
2answers
971 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 ...
52
votes
3answers
16k views

What's the Magit equivalent of 'git add'?

What is the Magit equivalent of git add [--intent-to-add] <filename> for checking a newly created file into Git?
3
votes
0answers
567 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 ...
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 (...
9
votes
1answer
625 views

How to well deal with the git diff with compatible to visual-line-mode?

I typeset my manuscript in org-mode with visual-line-mode turned on. Physically one of my paragraphs is just a line which is soft-wrapped. In this case, when I tried to git diff (magit) to see what I ...
1
vote
0answers
237 views

Syncing org files under version control and MobileOrg

I have a setup in which I keep my .org files in a git repo, with one fork in my laptop and other in my office computer (whose filesystem I can access remotely always). I recently set up MobileOrg in ...
2
votes
2answers
978 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 ...
2
votes
1answer
209 views

Both VC and Magit cannot see global .gitignore

I'm using emacs on Windows and this is long bothered me. All other apps correctly ignore all listed in global .gitignore, but in emacs they are untracked/unregistered and pollute the status window.
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 ...
1
vote
1answer
695 views

How do I disable the colored marks that appear next to changed lines when using git?

I am using orgmode and after I put my files under git I see some lines that appear next to lines that have changed. They are red, green or blue. I would like to disable this but have no idea how they ...
25
votes
1answer
3k 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 ...
6
votes
3answers
394 views

Viewing Github PRs in Magit 2.1.0

In the previous version of Magit, I learned from oremacs that you can view and checkout Github pull-requests in Magit by adding the following line to a remote's definition in .git/config. fetch = +...
6
votes
1answer
1k views

Auto refresh buffer upon git checkout

When I use git checkout to change to a different state of a project with files open in emacs with different state, the files are not changed automatically. Instead on any modify attempt, emacs is ...
1
vote
1answer
556 views

Automatically quit emacs after git-commit-commit in git-commit mode

I am using emacs -nw as in-place commit message editor for my git. When pressing C-c C-c in git-commit mode, I want emacs to quit automatically. Currently, .git/COMMIT_EDITMSG is saved, and the buffer ...
44
votes
2answers
13k views

How can I discard changes to unstaged files using magit?

Is there a way to issue the command: git checkout NameOfFile on a modified and unstaged file from within MAGIT?
5
votes
2answers
1k views

What is the work-flow for applying a patch?

Let's say I have this patch file from emacs git. I usually fix stuff manually by reviewing the patch files. But I am sure there is an automated way to do that. I played a bit by opening package.el in ...
6
votes
1answer
1k 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. ...
7
votes
3answers
2k views

Customize vc-mode appearance in mode-line

I use vc-mode to show information about the current VC state in my mode line, like this: (setq mode-line-format '(… (vc-mode vc-mode) …)) However, I find the default format of vc-mode pretty verbose....
5
votes
1answer
235 views

how to produce a dired buffer listing all untracked files?

git status tells me names of files that are currently untracked. How can I get a dired buffer containing those files? e.g. if I run the command git ls-files --others --exclude-standard, I'd like all ...
2
votes
1answer
984 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 ...
3
votes
1answer
145 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 ...
0
votes
1answer
81 views

Is there a way to customize 'vc-update'?

Currently, running vc-update in my Emacs runs git pull. Is there a way to customize it so that it runs something different like git pull --prune? Is it even advisable to do that?
6
votes
3answers
2k views

Disable evil-mode when git-timemachine mode is activated

How do I disable evil-mode in a buffer in which git-timemachine is activated?
9
votes
3answers
2k views

How can I visualize VCS status in dired?

I'm particularly concerned with git, but I imagine this is a good place to use vc. I want to emulate Atom's git integration with its file explorer: How can I get something like this in dired? I ...