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
61
votes
1answer
7k views

Can I checkout a given commit from magit's log view?

I'm exploring a git repository history using magit's log view using l l. Can I checkout a given commit from there without going to terminal?
9
votes
3answers
2k views

Get git repo root directory, preferably with magit

How can I get the root directory of the current git repo? I could run shell-command-to-string on something like git rev-parse --show-toplevel. Is there a better way? Does magit or any other git front-...
27
votes
3answers
11k 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?
5
votes
2answers
629 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 .#...
8
votes
2answers
1k views

Default commit comment for magit

Is there a simple way to have default text pre-populate in the comment buffer when commiting code with magit?
55
votes
2answers
10k 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 ...
21
votes
2answers
4k views

How can I list available tags in Magit?

I would like to list the available tags in Magit in order to diff a specific revision, is this possible? Specifically what I am after is to list the revision history at a certain tag and then view ...
2
votes
1answer
753 views

Locally added file under the Git version control system

Whenever I save my main.el file, I get the following error. apply: Args out of range: #("Git@" 0 4 (help-echo "Locally added file under the Git version control system" face vc-locally-added-state)), ...
10
votes
1answer
3k views

How to automatically encrypt orgmode files?

I have a git repository where some org-mode files live. Some of them have a private nature and the server where the git repository lives can be accessed by some untrusted third party. Thatswhy I want ...
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 ...
53
votes
4answers
13k 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, ...
1
vote
1answer
206 views

How to deal with packages when manage .emacs.d file with version control system? [duplicate]

I'm trying to use git to manage my .emacs.d directory. I occur this problem: Some package files are already managed by package-tools such as el-get,package.el via git. If I add them into my git ...
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 ...
0
votes
1answer
202 views

git-stage the current file-visiting buffer?

I've never really used vc but it looks like it only supports add or commit actions. I reckon magit must have some of the machinery to achieve this, but browsing its codebase didn't reveal anything ...
5
votes
1answer
154 views

Insert and strip helpful comments from vc commit message buffer

When I run hg commit (or git commit, same difference...) from the command line without supplying a commit message it pops up an emacs buffer with the following contents: . . HG: Enter commit message. ...
13
votes
1answer
4k views

Projectile does not show all files in project

After visiting a file that is part of a git repository, Projectile acknowledges the existence of my git repository as a project, but it only lists one file (the current file) as being part of the ...
1
vote
2answers
433 views

Origin of some modeline indications: Git:master [i,#]

In my mode line, to the left of where it describes the current modes e.g. (Org company), there is text that looks like [#] or sometimes [i,#], where the i and # signs are highlighted. I don't think ...
5
votes
3answers
586 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 ...
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 ...
10
votes
8answers
1k views

magit-push hangs on Windows

I'm using GNU Emacs on Windows, and I am unable to use magit-push to push my local changes to a remote repository. This happens with remote repositories regardless of if they are accessed with SSH or ...
4
votes
1answer
3k views

Magit on Windows: “searching for program: permission denied, git”

I installed Magit on Windows, but every time I use it, it give me the error: searching for program: permission denied, git even though I already installed the git software on windows. (it seems ...

1 2 3 4
5