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
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 ...
3
votes
1answer
932 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 ...
1
vote
1answer
407 views

How to install latest version of org mode?

I want to update to the latest version of Org-mode to test a bug fix. I followed the instructions: cd ~/src/ git clone https://code.orgmode.org/bzg/org-mode.git cd org-mode/ make autoloads Then I ...
49
votes
4answers
12k views

Change a branch's upstream with Magit

When you push a branch with Magit (with P P) and the branch has no upstream, Magit asks you the name of the branch you want to push to. That's great. Once you set the upstream for a branch, however, ...
16
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 ...
9
votes
1answer
538 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 ...
5
votes
2answers
569 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 .#...
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 ...
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 ...
26
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?
16
votes
3answers
2k views

How to start ediff-ing a file that has git conflict markers in it?

Following an attempted git merge on the commandline, my file now has standard conflict markers in it which emacs has helpfully reloaded (reverted?) in the buffer. How do I start some kind of merging ...
14
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 ...
2
votes
2answers
388 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 ...
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
58 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) ...
5
votes
1answer
2k views

magit: how to set default username?

Is it possible to set a default username (i.e.: my Github user name) for magit? It is prompting for the user every time I have to push a commit. Don't know if this may help with the answer, but I ...
2
votes
1answer
104 views

Error when loading new version of org mode

I upgraded Org-mode to the latest version on the master branch (according to How to install latest version of org mode?) and now I get this error every few seconds: Error running timer ‘org-indent-...
2
votes
1answer
254 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?
1
vote
1answer
422 views

Emacs opens gitbash in new system window

I've try to follow this question and sulution Git Bash in emacs on Windows I have this function: (prefer-coding-system 'utf-8) (defun git-bash () (interactive) (let ((explicit-shell-file-name "C:/...
0
votes
1answer
53 views

Is it possible to force `markdown-mode` during git commit?

I was using following answer: https://emacs.stackexchange.com/a/57535/18414 to set markdown on the .git/COMMIT_EDITMSG file. (add-to-list 'auto-mode-alist '("/\\.git/COMMIT_EDITMSG\\'...