Limiting file size in git repository

As I was struggling with it for a while, even with the description, and I think this is relevant for others too, I thought I’d post an implementation of how what J16 SDiZ described could be implemented. So, my take on the server-side update hook preventing too big files to be pushed: #!/bin/bash # Script … Read more

How do you detect an evil merge in git?

The easiest thing to do would be to diff the results of your conflict resolution with a merge that auto-resolves conflicts without human intervention. Any automatic resolutions will be ignored, since they will be resolved in exactly the same way. I see two ways of visualizing the possible “evil” resolutions. If you are making this … Read more

Git slows down Emacs to Death – How to Fix this?

There’s a built-in profiler called ELP. You can try something like M-x elp-instrument-package, enter “vc”, and then try finding a file. Afterwards, M-x elp-results will show you a profile report. (Note that if the time is instead being spent in non-vc-related functions, this technique will not show it, but you can instrument further packages if … Read more

How to make ‘git diff’ ignore comments

Here is a solution that is working well for me. I’ve written up the solution and some additional missing documentation on the git (log|diff) -G<regex> option. It is basically using the same solution as in previous answers, but specifically for comments that start with a * or a #, and sometimes a space before the … Read more

Difference between git-log and git-whatchanged?

The commit 52f425e1 (August, 30th 2013) mentions: Encourage new users to use ‘log‘ instead. These days, these commands are unified and just have different defaults. ‘git log‘ only allowed you to view the log messages and no diffs when it was added in early June 2005. It was only in early April 2006 that the … Read more

Git create branch from range of previous commits?

You can do this with cherry-pick. If your history of long_branch looks like this: A-B <– master \ C-D-E-F-G-H <– long_branch and you want to move the contents of, say, F through H to a different branch, say, short_branch, which is based off of master: git checkout master -b short_branch which gives A-B <– master, … Read more