git-diff

How to compare/diff specific version of master and fork repo in github

你。 提交于 2019-12-01 07:12:08
问题 There are two repos on Github: "Repo1" is a master that has regular commits (not yet forked by me) "Repo2" is a fork of Repo1 from about 2 years ago (not yet forked by me) I want to do a DIFF between the two Repos, based on the version of code in "Repo1" that was branched by "Repo2" (approx 2 yrs ago). My objective is to then get the most recent code from "Repo1", and the now isolated changes from "Repo2", and merge these into a new "Repo3", effectively bringing the changes added to a fork 2

`git config interactive.diffFilter diff-highlight`: the same diff by lines - and without color

一世执手 提交于 2019-12-01 07:07:36
问题 After git config --global interactive.diffFilter diff-highlight my .gitconfig : # This is Git's per-user configuration file. [user] name = Vitaly Zdanevich email = vitaly.zdanevich@xxx.com [core] excludesfile = /Users/vitaly/.gitignore_global [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge --skip -- %f process = git-lfs filter-process --skip required = true [diff] tool = vimdiff context = 20 [difftool] prompt = false [interactive] diffFilter = diff-highlight But in git

git diff tmp file invalid on windows when using external program on Windows 7

一个人想着一个人 提交于 2019-12-01 06:32:00
问题 I'm following the docs from the Git configuration page and trying to apply this to my Windows 7 environment. When I run say, "git diff file0" I get an error in P4Merge: Errors: '/tmp/cH9ccM_file0' is (or points to) an invalid file. This is a true statement. I do not have a directory called "/tmp". I've checked in C:\tmp, C:\cygwin\tmp, and %PROGRAMFILES%\Git\tmp. Any ideas on how to change this directory to something I do have? EDIT: Additional info. Ultimately, I'm trying to get WinMerge (or

How to know local repo is different from remote repo, without fetch?

霸气de小男生 提交于 2019-12-01 06:06:05
I got tens of repos, my script should update them if any difference happened, new commits, new tag, new branch. Fetch is kind of slow for tens of repos in my case, I'd like to know if there is any quick command could meet my requirement. mockinterface You can use the git ls-remote plumbing command to obtain the state of the remotes without fetch. Here, let’s use git itself as a lightweight database, to keep track of the state of the remote. Put the following in a script; you can enable it later as a git alias shell function for convenience. Run inside your repo. REMOTE_SUM=$(git ls-remote -

How to know local repo is different from remote repo, without fetch?

六眼飞鱼酱① 提交于 2019-12-01 03:34:17
问题 I got tens of repos, my script should update them if any difference happened, new commits, new tag, new branch. Fetch is kind of slow for tens of repos in my case, I'd like to know if there is any quick command could meet my requirement. 回答1: You can use the git ls-remote plumbing command to obtain the state of the remotes without fetch. Here, let’s use git itself as a lightweight database, to keep track of the state of the remote. Put the following in a script; you can enable it later as a

How can I do case insensitive git diffing while also doing `git diff --color`?

£可爱£侵袭症+ 提交于 2019-12-01 02:49:11
Is it possible to do a case insensitive git diff while also doing git diff --color-words ? Or do I need to use an external diff program while doing git diff --color-words ? ( note: if all you want is git diff case insensitive please go to this question How to perform case insensitive diff in Git ) GIT_EXTERNAL_DIFF='diff -ipu "$2" "$5" #' git diff --ext-diff Or, in a nicer fashion without the # hack I used there: echo 'diff -ipu "$2" "$5"' >myscript; chmod a+x myscript; GIT_EXTERNAL_DIFF='./myscript' git diff --ext-diff I agree it would be nicest if git-diff would just have an -i option...

How to make git diff show the same result as github's pull request diff?

本小妞迷上赌 提交于 2019-11-30 17:52:00
After branches are merged, and github no longer show difference when i try to make a pull request, but git diff will still show differences. For example I have branch D, created hotfix on branch H, merged H to D, then created more stuff on D. Now git hub pull reuqest from H to D shows no difference but git diff H D show differences. What I am trying to do is to create a commandline tool to see which old branches (there can be a lot) don't have code differences to develop. right now I have to go to github, do a pull reuqest and select each branch to see if there are difference. Thanks Oliver

Is git's implementation of the patience diff algorithm correct?

此生再无相见时 提交于 2019-11-30 14:00:13
This question on Stackoverflow seemed to be a good candidate for the application of the patience diff algorithm. However, while testing my potential answer, I found that git diff --patience doesn't work up to my expectations (and, in this case, is no different from the default diff algorithm): $ cat a /** * Function foo description. */ function foo() {} /** * Function bar description. */ function bar() {} $ cat b /** * Function bar description. */ function bar() {} $ git diff --no-index --patience a b diff --git a/a b/b index 3064e15..a93bad0 100644 --- a/a +++ b/b @@ -1,9 +1,4 @@ /** - *

How to setup kdiff3 in Mac OS?

对着背影说爱祢 提交于 2019-11-30 12:04:44
问题 In .gitconfig file I setup up the git diff as follows: [diff] tool = kdiff3 [difftool "kdiff3"] path = path_directory/kdiff3.app In this setting kdiff is not accessible and I get the following error when I run in terminal >> git difftool The diff tool kdiff3 is not available as 'Kdiff_local_software_path/kdiff3.app' fatal: external diff died, stopping at modified_file Do you have any suggestion I can fix this issue ? In my current setup Mac OS 10.10.5 git diff tool is git merge tool that I

GIT - How to list only newly added files between two branches

我的梦境 提交于 2019-11-30 11:55:43
问题 how can I list newly created(added) files between two branches? I can list all files that have been changed with: git diff --color --name-only branch1..branch2 But that also contains files, that just changed their content, not necessarily new files. Is there some git command for this, or do I have to checkout each branch and compare the files, e.g. with bash? Thanks. Filip 回答1: Just replace --name-only with --name-status . This way git will show if the file is added, deleted or just modified.