Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
21 views

Connection problem to Github

When I try to evaluate a Quelpa expression that fetches a package from Github, it throws the following error Debugger entered--Lisp error: (error "Command ’(env LC_ALL=C git clone https://github.com/...
0
votes
0answers
28 views

How to ask magit to use external diff and merge tools?

I have set the git variables [merge] and [diff] to the appropriate values like this: [merge] keepBackup = false; tool = p4merge [mergetool] prompt = false [mergetool "p4merge"] cmd = ...
0
votes
0answers
47 views

Alternatives to Git on Windows due to its slowness

I am forced to use Windows 10 on my job, so I use native Win32 Emacs. Also use Emacs on WSL (compiled from emacs mirror though tried the default Ubuntu 18.04 too). I tend to use more the one on WSL, ...
2
votes
2answers
88 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 ...
0
votes
1answer
41 views

How to prevent Magit from saving COMMIT_EDITMSG?

When I hit c c in the Magit buffer it opens the commit message buffer. Then I write my message and type C-c C-c to close it. For some reason it saves .git/COMMIT_EDITMSG and every next time when I hit ...
1
vote
1answer
31 views

How to detect programmatically if content under org-mode headline is encrypted or not before a save or commit?

org-mode allows users to encrypt the contents under a headline by adding the crypt tag with C-c C-q crypt and then calling M-x org-encrypt-entry. Below is an example using this feature: * Headline ...
1
vote
0answers
35 views

Show Git gutter after linenumbers

I am using emacs-nox and as some of you know there are always some problems if you want to display you line numbers while also using git-gutter. (Stuff like some extra margin jumping numbers etc.) ...
1
vote
1answer
133 views

How to diff a single, unstaged file in magit-status?

How can I display a diff for the actually selected file in magit-status? What can I do in do display a diff of build/conf/local.conf? With the now deprecated git-status, I could run git-diff-file (...
1
vote
0answers
38 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 ...
1
vote
1answer
54 views

How to get sorted output from counsel-git-grep with ivy?

When using git-grep, the output isn't sorted alphabetically which makes navigating the results more tedious then it should be. Is there a way to sort the output? I checked git-grep and it seems ...
4
votes
1answer
103 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 ...
1
vote
1answer
42 views

pipe buffer contents to shell as pseudo-file

I'd like to use wdiff to compare the contents of the current buffer to a previous version of the file the buffer is visiting. So, this would be a word-level live diff of the current buffer against a ...
2
votes
1answer
168 views

Recover/undo discarded changes in git/magit on unstaged files

I accidentally pressed "k" (a magit command) and discarded some unstaged changes. Is there a way to undo this? Or did I discover one of the few ways to actually lose work while using git?
1
vote
1answer
98 views

Magit: patches that ignore some whitespace changes do not apply

Context: I'm doing a merge, and fixed the conflicts manually. Now I'm trying to stage changes hunk-by-hunk and make a commit. Issue: some hunks are not getting staged. Here's the output from magit-...
4
votes
1answer
96 views

Create patch for one file with Magit

With command line git you can use git format-patch [commit_hash] [file] to generate a patch for a single file. Is there a way to generate a patch in magit for only a single file? I tried marking the ...
2
votes
1answer
30 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-...
2
votes
1answer
198 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
56 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 ...
0
votes
2answers
78 views

Show a list of names for all git projects

Windows 10, Emacs 25.1, Helm, Magit I have many git projects in different folders. Is it possible to show list of names for all git projects in one buffer?
1
vote
1answer
169 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?
1
vote
1answer
135 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:/...
1
vote
1answer
101 views

Git commit line length constraints

I'm quite new to emacs and a lot of the documentation I'm finding online is going over my head a bit at the moment. I've been using emacs as my git editor for a while now by mostly eye-balling ...
0
votes
1answer
85 views

git-commit-mode with flyspell very slow

I use emacsclient as my git commit editor. This is what I have in my init file: (require 'git-commit) (add-hook 'git-commit-mode-hook 'turn-on-flyspell) I just made a huge commit (update of a third-...
0
votes
2answers
112 views

Edit commit messages in markdown mode

I configured git so that it uses emacsclient when editing commit messages. The only problem is that these messages are edited in fundamental-mode. Which hook should I use to have these commit messages ...
4
votes
1answer
211 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 ...
1
vote
1answer
420 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 ...
3
votes
1answer
85 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 ...
1
vote
1answer
53 views

How can I determine if a `git` branch is a remote-tracking branch using Magit?

Is there a function magit-magic such that (magit-magic "master") => t (magit-magic "origin/master") => nil assuming origin/master is a fetched, but possibly unpulled branch on remote origin? (...
0
votes
1answer
22 views

Rewriting all file when save some changes

I work on Rails project in my Emacs25. When I change one specific file and save changes I got all file changed (from git diff). But when I try to old and new versions of this file in Meld - I get ...
2
votes
1answer
339 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 ...
3
votes
1answer
265 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 ...
4
votes
1answer
184 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?
2
votes
1answer
194 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
2answers
251 views

Merge specific files with magit

Is there a way to merge single files in magit like you would do from this question or something equivalent. Namely: $ git checkout source_branch -- <paths>...
2
votes
2answers
1k views

How can I do a git diff on the current file?

I'd like to do a diff on the current file / buffer compared to the git repository. Ideally a single function that could be called, or binded to a keyboard shortcut.
1
vote
1answer
105 views

Magit diff with --name-only?

I am browsing the differences between two branches of a repository via git diff --name-only branch1 branch2 I also use the --name-status option sometimes, since I may need to see what sort of ...
0
votes
1answer
240 views

Git bash opens in window outside of emacs

When running Emacs on Windows 10, I am able to launch git bash from within Emacs using the information given here, here, or here. For example, I can just add these two lines to my .emacs: (setq ...
1
vote
2answers
78 views

magit: The work for five tasks are mixed in my working directory

So during a hectic coding session, I forgot to do git commit as I did baby steps. Now I have fifty changes in my working directory. And these changes are related to five separate tasks. So I would ...
3
votes
1answer
454 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 ...
0
votes
1answer
96 views

Is there a Magit hook for post checkout?

Unfortunately, the vc-mode in my mode-line is not being updated when checking out a branch, it still points to the older branch. revert all open buffers fixes than but I can't find a hook to attach ...
0
votes
2answers
139 views

Magit reuse same window for different project when switching window

I'm a new user of magit and I'm currently using it in a separate frame with a single window (magit-status). I'd like that to show the git status of the project of the latest visited buffer. Imagine ...
1
vote
1answer
219 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.
1
vote
0answers
127 views

How do I do a `git add` with vc-git?

I want to stage a file or a hunk using vc-git (the vc system that comes with Emacs). How do I do this? (To clarify, I made modifications on a file that is already (registered) in git. I would like to ...
4
votes
1answer
215 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
66 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
74 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
48 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 ...
4
votes
2answers
661 views

Advanced git grep from within emacs

I've been playing with vc-git-grep as pointed to by this answer How do you grep from within emacs ( git grep 'foo' | grep baa ) I have a special requirement like this: $ git grep -e 'include'...
2
votes
1answer
160 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?
11
votes
1answer
616 views

Is there bitbucket integration for emacs?

I am looking for listing pull requests on bitbucket that I created from emacs. I found this https://github.com/tjaartvdwalt/bitbucket.el, which seems to be incomplete. Is there any other package out ...