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
0
votes
1answer
22 views

Git commit multiple files

When I go to commit my changes VC seems only allows me to commit one file at a time via C-x v v. Is there a way for VC to commit more than 1 file at a time?
0
votes
0answers
109 views

Syntax highlighting for comments in Magit commit buffers with custom core.commentChar

I frequently source the body of my GitHub PRs from my commits, and thus is makes sense to consider my commits to be made in Markdown (it is nice to have a markup language for commits anyway). Thus I ...
0
votes
1answer
26 views

Git Repo for Doom Config With Different Platforms

I have emacs on two separate platforms, and I would like it to function in much the same way on both, but there is some platform-dependent configuration as well. I have created a git repository in my ....
0
votes
0answers
37 views

Cannot figure out why vc-git.elc is always loaded on startup

This is more a curiosity, than a necessity. I'm playing around with startup times, and to have something to compare with, I wanted to see how fast emacs could start up pure. Running emacs -Q, emacs-...
2
votes
1answer
96 views

Cannot edit “.gitignore” due to strange errors and read-only switched on

A new error has occurred with a recent upgrade to Emacs 27.1. I'm trying to edit .gitignore and get the following error: *ERROR*: Unlocking file: Invalid argument, <directory>/.gitignore To ...
0
votes
0answers
20 views

(Version-Control) Branch Agnostic Undo

Has anybody tried implementing (VC) branch specific undo's? It would have to be agnostic to changes both inside Emacs and from the outside when Emacs is running using file-notify-.*. One solution ...
0
votes
1answer
37 views

Magit remove local branches that were merged into another branch

Explaining the problem more in-depth than the titular definition: Often I merge branches into master and want to prune based on that. M-p works fantastic for removing the remote branches (eg origin/...
0
votes
0answers
10 views

How I can see difference between working file and index with vc-diff and vc-ediff command with vc-git?

vc-diff and vc-ediff seem to show changes between working file and HEAD. I would like to see difference between working file and index instead. How can I do that?
0
votes
1answer
28 views

Cannot paste text copied from Emacs to synchronous subprocess

TL;DR When trying to paste text copied/killed in Emacs to another program while Emacs is waiting for a synchronous subprocess to finish, the target program hangs until Emacs becomes responsive again. ...
0
votes
1answer
27 views

Magit Move Submodule

In git bash I can use git mv home/subdir_1/my_submod home/subdir_2/my_submod to move a submodule between directories. Git handles changing .gitmodules and stages the change to be committed. Is there a ...
0
votes
2answers
37 views

magit status and git lfs files diff shows pointer diff

When I call magit-status git lfs files are shown as follows. modified src/myfile @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:...
0
votes
1answer
57 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\\'...
0
votes
1answer
34 views

How to stage selected lines / hunks in diff-mode?

Is it possible to stage changes in diff-mode? Or is this only possible with magit+ediff?
1
vote
1answer
28 views

While merging, how to tell Magit to use one version of the file?

When I merge something and there are conflicts, I can go to the file in the magit status page (SPC-g-s) and press, for example, e to start ediff. Within that, I can scroll through all conflicts and ...
0
votes
2answers
57 views

How do I modify magits behavior to use the date that I finalize the commit and not the date that I start the commit

Desired Solution: I want magit to make a commit with a datetime set to the time that I "create" the commit, not the time that I start the commit "creation" flow. Background: So committing in magit ...
2
votes
1answer
61 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) ...
2
votes
1answer
57 views

How to develop a package I also have installed?

When developing a package which is also installed via an online repository, there is a practical problem. /source/my-emacs-package git repository where I have my code. ~/.config/emacs/elpa/my-emacs-...
2
votes
1answer
113 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-...
1
vote
1answer
65 views

How to activate diff-mode from command line?

Git's editor config is set to launch emacs in no-window mode and to execute lisp function diff-mode: git config --global core.editor "emacs -nw -f diff-mode" However, when I execute git commit -v to ...
1
vote
1answer
482 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 ...
1
vote
1answer
72 views

Git Texinfo indices missing

I have installed the official Git documentation in Texinfo format on my computer and for Emacs. But when I try to search for something with I in the info buffer (C-h-i d m git) it reports no indices. ...
0
votes
2answers
118 views

How to match the nondirectory part of a filename with a regular expression?

Whats the correct way to match a filename from a full path using string-match-p. Say I want to check if the file is a git commit message COMMIT_EDITMSG or svn-commit.tmp or svn-commit.3.tmp to pass ...
1
vote
1answer
118 views

How to search certain subdirectories of directories that are ignored by Git

I'm working in a Scala project that has target/ directories entered as ignored in the .gitignore. However, there is also Scala code being generated during the build which is being nested under a ...
3
votes
1answer
61 views

Magit: Howto create a new commit ignoring white-space differences

I'm using magit 20191128.39 on Emacs 26.3 When changing a python script resulting in a new unstaged change, git/magit should ignore whitespace-differences. A git diff -w will do the trick, but I'd ...
0
votes
1answer
68 views

How to abort an ediff merge?

I use ediff to merge mercurial conflicts (and sometimes git conflicts), but I can't seem to abort. Ediff pops up as soon as a conflict is detected, and quitting and not saving results in mercurial ...
0
votes
1answer
43 views

el-get Basic Setup (https://github.com/dimitri/el-get) : error: Unable to find 'git'

Start Emacs from gitbash (MINGW64) Snippet below is loaded automatically: ; add el-get to the load path, and install it if it doesn't exist (add-to-list 'load-path "~/.emacs.d/el-get/el-get") (...
1
vote
0answers
28 views

Git status on modeline to indicate if behind remote?

Can I get Emacs to indicate on the mode-line whether a push is needed, i.e. whether the repo is out of sync with origin? I've already got it telling me if a commit is needed using vc-status, but that ...
0
votes
1answer
84 views

Magit pull with merge/rebase from upstream/pushRemote

I have upstream set to the develop branch (say origin/master) and pushRemote to a feature branch. I currently use pulling with preserving rebase. I would like to setup magit in such a way that: ...
5
votes
1answer
47 views

What is the equivalent of doing a plain `git reset <sha>` in magit?

I sometimes want to undo a commit without losing the changes, but just placing them back into an uncommitted and unstaged state. To do that at the cli, I do just git reset <sha-of-previous-commit&...
1
vote
1answer
99 views

Magit merging changes manually

When I do merge preview m p I see a log of other branch changes for each affected file. Changes marked like this: @@ -20,6 + 22,7 @@ - <change> + <change> To merge only a ...
3
votes
1answer
214 views

How can I back up my init file with Git?

The docs say to keep the .emacs file in the HOME directory. I'd like to share the file between multiple computers using a git repo. What is the best way to structure the repo without including ...
3
votes
1answer
127 views

Cannot get Magit to show the commit signatures in the log

In order to prove that I had a signature on a commit I needed to use a this command line command: $ git log --show-signature -1 I could not get Magit to display the signature I tried to use the ...
1
vote
0answers
31 views

Is there is an existing parser for `.gitignore` files?

Is there is an existing parser for .gitignore files? Maybe there is some Elisp package that includes something like this? Ideally, I would like to be able to read a .gitignore file in a given ...
4
votes
1answer
118 views

Can magit pull hunks from another commit into my branch?

I have a big commit on another git branch. I'd like to "cherry-pick" some hunks from that commit into my current branch. I bet magit can do that, but I'm not sure how. Anyone? (I've seen ways to ...
4
votes
1answer
96 views

Disabling automatic add after resolving git conflict

After updating emacs (to 25.2.2 as shipping in ubuntu 18.04) I notice a change that completely breaks my conflict resolution flow in git. Once I resolve a conflict using emacs and save the file, emacs ...
1
vote
1answer
37 views

how to copy a deeply nested binary file from one git repo to another [closed]

I want to copy an image file from one github repo to another. The source and destination file paths are deeply nested within the repo (eg. copy ~/code/repo1/src/components/A/components/B/common/...
0
votes
1answer
57 views

How to specify multiple patch files to be applied by Magit?

The Magit user manual says in the description of `w w' (magit-am-apply-patches): w w (magit-am-apply-patches) This command applies one or more patches. If the region marks files, then those ...
2
votes
1answer
50 views

Package to help display status of each git repo contained in a common directory

I have a directory and in the directory is a rather long list of git repositories. Is there a package or options where a dired listing of the directory would also add in the status of each git repo ...
0
votes
0answers
70 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/...
1
vote
1answer
237 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
501 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, ...
3
votes
2answers
508 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
202 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
56 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
164 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
195 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 (...
3
votes
1answer
177 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
127 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
416 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
111 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 ...