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
3
votes
1answer
724 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
290 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
589 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.
53
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 ...
59
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
220 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
86 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
156 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
231 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
433 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
251 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
194 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
200 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 ...
12
votes
2answers
12k 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
491 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-...
1
vote
1answer
218 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
145 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 ...
27
votes
3answers
10k views

Untrack file without deleting it?

I have a tracked file in a git repository. How do I untrack this file without deleting it using magit?
3
votes
1answer
422 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
275 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 ...
2
votes
1answer
547 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 ...
1
vote
1answer
71 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
2
votes
1answer
968 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 ...
1
vote
1answer
756 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 ...
3
votes
2answers
771 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) ...
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 ...
5
votes
1answer
959 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 ...
16
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 ...
1
vote
1answer
888 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 ...
2
votes
2answers
927 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 ...
3
votes
1answer
969 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 ...
8
votes
1answer
579 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
1answer
201 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 ...
6
votes
3answers
384 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 = +...
1
vote
1answer
616 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 ...
5
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. ...
1
vote
1answer
502 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 ...
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 ...
2
votes
1answer
746 views

Locally added file under the Git version control system

Whenever I save my main.el file, I get the following error. apply: Args out of range: #("Git@" 0 4 (help-echo "Locally added file under the Git version control system" face vc-locally-added-state)), ...
3
votes
1answer
141 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 ...
5
votes
1answer
215 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 ...
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?
0
votes
1answer
79 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?
8
votes
2answers
1k views

Default commit comment for magit

Is there a simple way to have default text pre-populate in the comment buffer when commiting code with magit?
5
votes
2answers
592 views

untracked “.#file” in a git repository?

Q: where do untracked .#files come from when working in a git repository? When working on file example.txt in a git repository, I occasionally get an untracked file showing up in status titled .#...
10
votes
1answer
2k views

How to automatically encrypt orgmode files?

I have a git repository where some org-mode files live. Some of them have a private nature and the server where the git repository lives can be accessed by some untrusted third party. Thatswhy I want ...
1
vote
1answer
203 views

How to deal with packages when manage .emacs.d file with version control system? [duplicate]

I'm trying to use git to manage my .emacs.d directory. I occur this problem: Some package files are already managed by package-tools such as el-get,package.el via git. If I add them into my git ...