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
1
vote
2answers
29 views

Open the same file on a different commit

I have a local git repository with a certain git commit checked out. A running emacs instance has an open file inside one of the buffers. How do I quickly open the same file inside a new buffer, but ...
0
votes
3answers
70 views

How can I recursively find and replace in the current git repository

I am working inside a git-repo. Here I want to apply my search operation based on the root directory of the git repo that current buffer is open. Here I do: find-dired "~/my_project" ... in ...
0
votes
1answer
127 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: ...
0
votes
0answers
30 views

MAGIT: meaning of magit status: head, rebase, push (git newbie)

In my magit status I see the following: Head: master Commit message Rebase: origin/master Commit message Push: origin/master Commit message I may have done something (pressed some keys) ...
4
votes
1answer
384 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 ...
0
votes
1answer
30 views

Load right version of Git while connecting to remote

I am currently working on a remote using Lmod for handling modules. I want to use Magit with the repositories on this remote, but the default system version of Git is 1.x. However, Git 2.18 is ...
1
vote
0answers
63 views

How to exclude certain directories/files from `consult-git-grep` search?

I want to exlude certain files such as .gitignore in consult-git-grep search. consult-git-grep works find with following defualt setup: (setq consult-git-grep-args "git --no-pager grep -F -n --...
1
vote
1answer
174 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
101 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
1answer
58 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
18 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
39 views

How to exclude certain directories/files from counsel-git-grep search?

Would it be possible to exclude certain directories/files from counsel-git-grep search, such as .gitignore? Here I don't want to see matches in .gitignore file: I have tried adding ':(exclude)....
0
votes
1answer
24 views

provide optional parameter for magit

I am tracking my dotfiles by using this approach. This is very useful method to track files which are in different locations. Short summary of the blog. alias dotfiles='/usr/bin/git --git-dir=$HOME/....
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 ...
1
vote
1answer
17 views

Why this magit process happens after pushing some changes to a remote repository? How to avoid it?

After pushing some changes to a remote repository using magit, Emacs shows this process running: git-credenti... 72390 run *git-creden... /dev/pts/1 git credential-cache--daemon /home/pedro/....
3
votes
1answer
161 views

How to use `--no-edit` flag in a `git commit --amend` process inside magit?

If I am using the terminal, after staging some changes, I can do: git commit --amend --no-edit This will insert the staged changes on the previous commit. The editor to edit the message was not open ...
0
votes
1answer
38 views

Ignore file encoding in diff

My magit diff is full of "differences" where there is no visually discernible change. I've adjusted every Magit Diff Option. Configuring magit to ignore line endings, tabs, whitespace, and ...
3
votes
1answer
252 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-...
0
votes
1answer
34 views

Git track flag in Dired

How can I show an additional column in Dired, where I can see if the file is tracked or not by git in the current branch?
17
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 ...
2
votes
1answer
143 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. ...
1
vote
1answer
51 views

Why I am unable to squash these commits on magit?

I am trying to squash some commits using magit. I tried two different approaches choosing different commit ids to pick and squash. Despite the fact that none of them worked out, the error messages ...
0
votes
2answers
51 views

Retrieve file from an earlier commit

I am using Doom Emacs 2.0.9 on Emacs 27.2. I use magit to manage a local git repository. In an earlier commit, there was a file. In the latest commit as well as the current working tree, the file no ...
0
votes
1answer
37 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 ...
12
votes
1answer
335 views

How can I make 'git diff' aware of Emacs Lisp functions?

When diffing with Git, for most languages, it provides a function name in the chunk header, allowing to get a better grasp on the context, e.g., @@ -7,5 +7,6 @@ int main() { if(condition()) { ...
2
votes
0answers
26 views

How do I jump to the previous/next modification (relative to the git HEAD) in the current file?

How do I jump to the previous/next modification (relative to the git HEAD) in the current file? Ideally, I like sth like swiper that lets me choose to easily jump between modifications.
0
votes
0answers
37 views

Automating git rebase and solve conflict

I have a script can solve some conflict on certain file. How can I automate the work flow to do the following? Run git rebase If has conflict, run script try to solve it. Then run git rebase --...
2
votes
0answers
44 views

Switch README from Markdown to Org, having problem with image rendering

I have a repository on Gitlab, I'm trying to change my README from Markdown to Org, I'm fully able to make the changes, but for reasons the the images are having some sizing issues, they expand ...
0
votes
0answers
17 views

'(auto-revert-tail-mode t t) - duplicate content of buffer in git folder

Linux Mint 20 Emacs 27.2 In my init.el I has: '(auto-revert-tail-mode t t) And as result when I open file that in git repository (in folder with .git folder) then content of file is duplicate. When ...
2
votes
1answer
69 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 ...
0
votes
0answers
30 views

Remove stale buffers after switching to a different branch

This is the scenario: Switch to a new git branch Open some "new files" in that branch Switch back to an older branch that doesn't have these "new files" I want these opened ...
3
votes
1answer
2k 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 ...
3
votes
1answer
59 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). ...
0
votes
0answers
48 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 ...
2
votes
2answers
157 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
21 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
20 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
0answers
170 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 ...
5
votes
2answers
4k 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
42 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
54 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.
2
votes
2answers
85 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
43 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
351 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
0answers
25 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
747 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
46 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
146 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
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
21 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 ...

1
2 3 4 5