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
33 views

magit equivalent to `git push -u origin newLocalBranch`

I often create new branches locally (e.g., newLocalBranch), and then push them to the upstream remote origin, thus creating a new remote branch, using git push -u origin newLocalBranch. Is there a ...
2
votes
0answers
18 views

Magit status section with recent checkouts / visited branches?

In the same fashion magit can offer the list of recent commits in a section of status buffer. I'd like to have a list of recent checkout/visited branches to be able to quickly switch to it (M-xbb). ...
1
vote
1answer
97 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
0answers
23 views

How to take line from recent commit with Magit

Use Magit to view the log with show diffs (-p). Inspect 4 commit old commit. Navigate to a few lines I've since deleted, but want back my project. I can mark the lines but cannot copy them, which ...
1
vote
2answers
53 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
13 views

Smerge: clearer refine mode?

I'm using doom+magit to deal with git, and I have smerge configured to change in-file conflicts. When I enable the smerge refine mode to highligh changes on a per-word basis, I find that refines works ...
0
votes
0answers
13 views

Smerge: auto-resolve LaTeX-like git conflicts

I'm using doom emacs + magit, and it enables smerge for me to display nicely my conflicts. I just saw that smerge has a function smerge-resolve to automatically resolve conflicts. I'd like to use it ...
0
votes
1answer
25 views

Pull from git before applying org-capture?

I'm using org-capture to take project-specific notes by having a notes file in each of several git repositories. Looking forward, however, I can see danger here: if I'm working on project (1) and I ...
0
votes
0answers
70 views

emacs27 : Depends: emacs27-common but it is not going to be installed

I has Emacs 25.3 emacs -version GNU Emacs 25.3.2 Copyright (C) 2017 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the terms ...
0
votes
1answer
66 views

Magit git commit isn't working on spacemacs

After installing Magit in spacemacs. I used Helm to create a git repository. I added some files to stage then tried to commit. Let me know if I'm doing something wrong or it's just an issue. I get: ...
3
votes
2answers
3k views

Magit how to use ssh key rather than being prompted for password

I've seen the question here but I'm not sure if the same solution would apply to me Magit, how to use system's ssh agent and don't ask for password I'm on Emacs 25.1 / Ubuntu 16.04. I've just ...
0
votes
0answers
18 views

How to git stage a just-tangled file in `org-babel-post-tangle-hook`

I want to create a org-babel-post-tangle-hook that does a git stage buffer-file-name. There is a boring technical issue I have, which is that I don't know how to call magit-stage-file from elisp so ...
0
votes
1answer
37 views

Why magit use rectangle on origin/master and not only on master?

I have done a branch checkout on master but magit rectangle is on origin/master and not only on master.
4
votes
1answer
251 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 ...
2
votes
2answers
72 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-...
0
votes
1answer
34 views

Magit: rebase and push, basic questions

I was learning magit and found this screenshot at Command to visit Github pull request of current branch with Magit: I was wondering why we have Rebase and Push (and not just Push) at the top. What ...
1
vote
1answer
76 views

What means Unmerged into origin/master in magit?

In the magit buffer I see Unmerged into origin/master, yet I'm not noticing see any issues while merging with magit or with git on the commandline. Searching for the the subject brought me here[0], ...
1
vote
1answer
146 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 ...
0
votes
1answer
64 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") (...
0
votes
1answer
37 views

How to apply a hunk of changes in diff to current branch?

I have two branches, let's say branch a and b, I would like to apply some changes from b to a. Note that I use magit-diff to show the differences between the two branches. Then I would like to apply ...
0
votes
1answer
9 views

Lags when navigating vc-root-diff buffer

When I move around the buffer *vc-diff* from vc-root-diff I experience lags. GNU Emacs 27.1 (build 1, x86_64-pc-cygwin) of 2020-10-29. With procmon I detected lots of: C:\opt\cygwin64\bin\git.exe --no-...
1
vote
0answers
23 views

Ignore file- and directory-variables when using “emacs -Q”?

I am using emacs -Q as editor for git, because my startup is too heavy for "quick editing" use and using emacsclient will hang when git is invoked with M-x shell-command. However, as a ...
3
votes
2answers
599 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

Can Emacs be set to auto-stage (preferably with --intent-to-add) new files?

I often add a new file to a repo, make some other changes, then stage all, and commit all, forgetting that the new file is not yet tracked, so is not included in the stage all step. At least one ...
0
votes
1answer
128 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 ...
4
votes
2answers
1k 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
0answers
35 views

Open git commit -v in diff-mode [duplicate]

How can I tell emacs to open COMMIT_EDITMSG in diff-mode by default? Specifically when issuing git commit -v, but the solution can be for all commit options.
0
votes
0answers
17 views

vc-annotate: strip the last character of git commit id

When editing a file managed by Git, vc-annotate shows the output of git blame. As Git usually does, revisions are identified by a short commit id. The short commit id is abbreviated to be one ...
2
votes
1answer
183 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-...
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....
0
votes
1answer
35 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?
2
votes
1answer
137 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
1answer
34 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 ....
1
vote
0answers
70 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-...
0
votes
0answers
21 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
2answers
68 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
0answers
12 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
38 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
39 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 ...
2
votes
2answers
453 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 ...
0
votes
1answer
71 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\\'...
3
votes
1answer
166 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 ...
0
votes
1answer
39 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
177 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 ...
1
vote
1answer
34 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
65 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 ...
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 ...
7
votes
2answers
3k views

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

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.
2
votes
1answer
76 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
3answers
546 views

What is the best way to reload git stashed changes you've popped while file is open in buffer?

When I'm viewing a file and then pop a stash which modifies that file in the working tree using git stash pop in either bash or eshell, what is the best way to immediately see those changes in the ...

1
2 3 4 5