diff

git diff to ignore patterns in files

瘦欲@ 提交于 2020-01-01 12:05:35
问题 I have a problem with git diff. Let me first fill you in on the history. I have just been given a rather unpopular project from a customer. The problem is that they have 2 branches in their scm. These two branches have not been merged for ages, nut now they have to merge them. Most of the changes are trivial, so merging via git only takes about 30 minutes. How ever, my customer do not trust that a merge process can be automated. Therefore they want to review the merge, by having a diff list

Git diffing crashes on Windows when submodules exist

怎甘沉沦 提交于 2020-01-01 11:49:03
问题 Using msysgit on windows, whenever I do git diff on a repository that has a submodule or several, the command prompt (and also PowerShell) crash. Is this a known but and is there a fix/workaround? Can I exclude submodules from diff? Also: PS Z:\www\gittest> git --version git version 1.7.6.msysgit.0 EDIT: This has also been reported on the msysgit google group. 回答1: I can't reproduce such issues with diff and submodules, but if you don't care about submodules diff, you can do: git diff -

multiple changes in one line with diff tool?

风格不统一 提交于 2020-01-01 11:02:20
问题 Normally, 'diff' tool finds only changes between lines. For example, if i compare 'abcdef' and 'AbcdEf', diff will show that 'abcde' is changed and 'f' is unchanged. Is it possible to find multiple changes per line, so in example above i will see that it's only 'a' changed to 'A' and 'e' changed to 'E'? Or diff outut format does not support such? 回答1: There are multiple diff tools that will do what you're asking for. Off the top of my head I know Winmerge and TortoiseMerge does that. 回答2: I

How to show revision history like revisions

人盡茶涼 提交于 2020-01-01 09:58:28
问题 How does Stack Overflow show the revision changes in the diff-like format they use? I don't care about Stack Overflow per se; it's just a convenient way to describe my requirement. I have an audit history of changes to a text field. I'd like to show the changes the same way Stack Overflow shows revision history changes. I recall a Stack Overflow podcast where Jeff Atwood discussed it, but I can't find it in the transcripts and have no idea what podcast. IIRC, it's not .NET based, maybe Python

Vimdiff: How to put all changes inside a particular function from one file to another?

无人久伴 提交于 2020-01-01 09:08:40
问题 In Vimdiff, I know I can use "do" or "dp" to move changes from one file to the other...but these are for individual changes. If I have to undo all changes inside a specific scope/selection (say undo all changes to a particular function, but leave the rest untouched), is there a way to do it in one go ? 回答1: You can use a visual selection and the ex command :diffget / :diffput So, for example to get the changes for just the current insides of a code block ( { ... } ) Vi}:diffget<Enter> To put

git: Log for 'master' only goes back to date bug?

回眸只為那壹抹淺笑 提交于 2020-01-01 08:28:07
问题 When I do the following in my working copy: > git diff 'master@{1 hour ago}' It prints warning: Log for 'master' only goes back to Thu, 14 Jan 2016 15:37:11 -0500. Yet when I do git log master , it clearly goes back farther: commit bb9c80fb1c3895a9c11f7a60710497cc8406e71f Author: Andy Edwards <andy@example.com> Date: Tue Jan 12 22:44:21 2016 -0600 ... Am I doing something wrong, or is this a git bug? 回答1: Use git-whatchanged instead. git whatchanged --since="1 hour ago" --patch 来源: https:/

diff files comparing only first n characters of each line

折月煮酒 提交于 2020-01-01 07:52:48
问题 I have got 2 files. Let us call them md5s1.txt and md5s2.txt. Both contain the output of a find -type f -print0 | xargs -0 md5sum | sort > md5s.txt command in different directories. Many files were renamed, but the content stayed the same. Hence, they should have the same md5sum. I want to generate a diff like diff md5s1.txt md5s2.txt but it should compare only the first 32 characters of each line, i.e. only the md5sum, not the filename. Lines with equal md5sum should be considered equal. The

Modern version of WinDiff? [closed]

眉间皱痕 提交于 2020-01-01 05:54:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . VB6 came with WinDiff . Is there a free modern version of WinDiff available that is able to ignore case? 回答1: Along with WinMerge and the WinDiff from the latest SDK, I also have SourceGear's free DiffMerge. I use WinMerge (which hasn't changed for a while either -- don't ignore blank lines; that exercises bugs)

Get git diff for any merged branch

霸气de小男生 提交于 2020-01-01 04:38:07
问题 For each defect in code I create separate branch. When defect is fixed I merge this branch in master, so I have history like illustrated below (we see two branches with fixes): defect1 fix defect2 fix a---b---c---d e---f / \ / \ ---o---1---x---y---z---2---o---3---w---4---o--- The question is how to get diff for fix1 (between branch start (1) and branch end (2)) or fix2 (diff between (3) and (4)) at any point of time (e.g. for any closed defect in past). Update: actual question is how to

Character-wise string diff in PHP

三世轮回 提交于 2020-01-01 03:30:09
问题 In short I am looking for something like google-diff-match-patch in PHP. I have had a look at some similar questions at SO, and also at the algorithm provided here, but all of them fail: diff("draßen", "da draußen") should not give <del>draßen</del> <ins>da draußen</ins> (which is kind of stupid for my purpose, because I want to compare file names), but (try here) <ins>da </ins>dra<ins>u</ins>ßen Is there a code snippet in PHP that does this? Unfortunately, I cannot use (i.e. install)