git-diff

Colored, side by side, inline git diff output in my terminal

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 11:38:24
问题 Please note this question is not a duplicate of, but a followup to the question "How can I get a side-by-side diff when I do “git diff”?". This question seeks new information and the solution to a problem. Also, please note that I am seeking only solutions whose output is inline in the terminal like the default git diff is -- I don't want anything which opens an external gui diff program. Progress so far I have followed the suggestion from the SO question linked above and put the following

View full file diff of `x` commits of a single file's history (that's hosted in git)

£可爱£侵袭症+ 提交于 2019-12-07 10:03:53
问题 Say I have a file in git called filex.code , and I want to see the full code of the last x versions of that file with each changed section highlighted -- all in one place. So an x -paned commit history of filex.code , almost as if I were doing an x -paned diff, but viewing historical versions rather than merging from different branches. The greater x , the better. Crossplatform would be great, but any of the Big Three works. Being able to edit the latest version would also be great, but read

Git Directory Diff does not work in my submodule

孤街浪徒 提交于 2019-12-07 08:55:05
问题 I am using Git 1.8.4 and Linux (Kubuntu 13.10). I have a Git repository with submodules. If I ask for directory diff in the main Git module, it works fine. If I do the same in one of the submodules, I get an error: ~/Projects/MAINMODULE/platform/SUBMODULE [master]$ git difftool -tool=meld --dir-diff --cached fatal: Could not switch to '../../../../platform/': No such file or directory diff --raw --no-abbrev -z --cached: command returned error: 128 ~/Projects/MAINMODULE/platform/SUBMODULE

git diff - show only what's new on the remote

纵饮孤独 提交于 2019-12-06 22:27:49
问题 I have a local repo and a remote repo on github. For business reasons, they aren't in sync. I've done a lot of work on the local that I'm keeping, and now I'm manually adding whatever's new to the remote, to my local. There are no branches. When I use the command, git diff --color master..origin/master I get good results, showing what changed.... what I have added to the local repo is marked with a - sign, and is shown in red; while what is on the remote is shown in green with + signs. Is

Can I make git add -p show changes like git diff --word-diff?

你说的曾经没有我的故事 提交于 2019-12-06 22:22:57
问题 I have recursively replaced many single word patterns in my code base. Before committing I need to check each for false replacements. It would help me a lot to have git add -p use the format of what --word-diff uses with git diff , where only the changed words are marked and not the entire line. Someone has asked the same here, but maybe it was implemented since? https://groups.google.com/forum/#!topic/git-users/7uO2OUJGvP0 回答1: Since Git 2.9, you can use the property interactive.diffFilter

Limit Git Diff to one or more functions?

非 Y 不嫁゛ 提交于 2019-12-06 19:41:37
问题 I set *.py diff=python in .git/info/attributes . So Git knows where function boundaries. git diff -W can even make sure the whole function is shown. But is there a way to limit the output of a git diff to just a particular function (or more than one)? (Failing that, I guess it's awk...) EDIT This would also be useful for git log and git rev-list : don't show me every commit that modifies views.py, show me commits that modify a certain function in it. (Yes, in an ideal world, views.py wouldn't

Exclude a single commit from a “git diff”

血红的双手。 提交于 2019-12-06 18:26:34
问题 Morning all, Let's say I have a series of commits as follows: abc000 def111 abc222 def333 abc444 def555 I know I can use $ git diff -c --binary abc000..def555 > /tmp/abc000_def555.patch to produce a patch to upgrade a system from abc000 to def555. But what if I wanted to (for reasons to dull to get into) exclude def333 from the patch - how can I do this? Note that I do not want to revert def333, its just that I do not want the patch to incorporate this commit. Thanks 回答1: Actually all git

Why does `git diff` not work with process substitution?

梦想与她 提交于 2019-12-06 17:15:47
问题 Why does git diff not work with process substitution? $ echo hallo > hallo $ echo holla > holla $ git diff hallo holla # works $ git diff hallo <(cat holla) # works not diff --git a/hallo b/hallo deleted file mode 100644 index 4cf5aa5..0000000 --- a/hallo +++ /dev/null @@ -1 +0,0 @@ -hallo diff --git a/dev/fd/63 b/dev/fd/63 new file mode 120000 index 0000000..864a6ca` Same with git diff --no-index . It works with plain diff . cat is only a trivial example, can be replaced by a non-trivial sed

Diff between commits in Visual Studio 2015 using git

ε祈祈猫儿з 提交于 2019-12-06 17:03:00
问题 Using Visual Studio 2015 Update 2 and git as source control, how do you diff between 2 commits on a branch? Note that I am not talking about diff on the granular file level (ie. view history of file and comparing), but rather for entire commits. I would expect to be able to compare when looking at the history of a branch, but the option does not exist. Here's the right click menu I see when I right click on a commit when viewing the history of a branch: Where's the compare?? 回答1: While not

git diff between working copy and branch base

故事扮演 提交于 2019-12-06 13:27:38
问题 I can compare the tip of master and my working copy with git diff master I can compare the tip of the current branch with its merge base from master with git diff master... Is the a git diff command to compare the merge base of the current branch and the working copy? 回答1: Is the are git diff command to compare the merge base of the current branch and the working copy? If you current branch is not master, you can try in a bash shell: git diff $(git merge-base --fork-point master) If uses git