Questions tagged [version-control]
54 questions
69
votes
8 answers
What should/shouldn't I do when keeping .emacs and .emacs.d in version control?
Like many people, I manage a lot of my dotfiles via a version control repository (Mercurial on Bitbucket, private, in my case). This is handy when setting up a new machine or propagating configurations among different machines.
So naturally I added…

Paul Bissex
- 833
- 8
- 9
63
votes
12 answers
Synchronize packages between different machines
I use emacs in different places and I want to have a similar setup and packages installed everywhere. I guess I can use a version control repository for the setup files. Since I use Prelude, that would be ~/.emacs.d/personal/.
I don't know how to…

El Diego Efe
- 1,601
- 1
- 19
- 24
35
votes
3 answers
Is there an Emacs mode which highlights differences from the committed version?
One feature that Xcode has which I think is pretty neat is a "Comparison" mode, which continually shows differences between the current buffer and the most recent commit.
Is there anything like this for Emacs? I don't really care about the…

Ken
- 351
- 3
- 3
28
votes
7 answers
Is there a simplified version control system appropriate for non-coders writing in Emacs?
I an academic and I love to do as much of my writing as possible in Emacs. A key thing that is missing for me is the ability to easily review the changes I have made to a text file over time.
The tracking features on Wikipedia articles or Google…

Brian Z
- 2,863
- 16
- 22
16
votes
2 answers
Only doing whitespace-cleanup on the lines touched
For most projects I work on I use a before-save-hook to run whitespace-cleanup. This is fine when everybody on the team cleanups up their spaces but sometimes I am involved in already running projects were most files are littered with trailing…

remvee
- 561
- 6
- 13
8
votes
2 answers
Why does my *vc-log* buffer start with "Summary:" in Emacs 24.4?
I just upgraded to Emacs 24.4 (from 24.3). Now, whenever I run vc-next-action on a modified file, the *vc-log* buffer that comes up starts with the word "Summary:" in log-edit-header face, followed by a line of inverse video.
This wasn't happening…

cjm
- 193
- 5
8
votes
2 answers
How do I ediff a buffer against a revision?
I want to run ediff to compare my current version of a file (in git) with a version of the file on a different branch.
I run M-x ediff-revision from within an open buffer for the file in question. I answer the two questions:
Compare revisions for…

P.T.
- 203
- 2
- 5
7
votes
1 answer
Is there a way to revert only certain lines from a diff hunk?
I use the builtin VC package and it's very nice that when I do a diff of changes in the current file then I can revert any hunk in the diff quickly with C-a
But sometimes I don't want to revert the whole hunk, only certain lines and keep other…

Tom
- 1,190
- 7
- 16
6
votes
1 answer
version control using the usual backup system of Emacs
This question is inspired by https://emacs.stackexchange.com/a/7831/ and the below settings borrowed from that answer :
(setq backup-directory-alist '(("." . "~/emacs-backups"))
version-control 'numbered
make-backup-files t
…

Name
- 7,689
- 4
- 38
- 84
6
votes
1 answer
How to abbreviate version control information in the mode line?
Q: how can I abbreviate the version control information in the mode line?
Buffers visiting a file under version control display branch information in the mode line as VCtype-branch. That's fine, but my mode line is already quite cluttered, so I'd…

Dan
- 32,584
- 6
- 98
- 168
5
votes
2 answers
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 -- ...

salotz
- 1,370
- 10
- 21
5
votes
1 answer
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.
Symptoms
Occassionally, Windows will report that…

kdb
- 1,561
- 12
- 21
5
votes
1 answer
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. Lines beginning with 'HG:' are removed.
HG:…

TheCommitments
- 51
- 2
5
votes
2 answers
Anatomy of ~/.emacs.d
I'm brand-new to Emacs and I want to put my ~/.emacs.d under version control, much like I've done in the past with my vim setup. I installed a couple packages before initializing a git repo, and now I'm sifting through the contents of emacs.d trying…

ivan
- 1,928
- 10
- 20
4
votes
1 answer
Version control information out of sync with certain modes
Sometimes, though seemingly not in a consistent way, some modes that use version control information do not get updated correctly after git commands are run (e.g.,diff-hl-mode or git-gutter-mode indicate uncommitted changes though those changes have…

elethan
- 4,755
- 3
- 29
- 56