diff

How to check real git diff before merging from remote branch?

。_饼干妹妹 提交于 2019-11-29 19:25:39
I want to check the real diff between remote branch and local branch. How can I do that? Issuing the below command partially works, but it shows the diff of the new changes of my local branch too. git diff remote/branch Evgen Bodunov From the documentation : git diff [--options] <commit>...<commit> [--] [<path>…] This form is to view the changes on the branch containing and up to the second <commit> , starting at a common ancestor of both <commit> . "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B". You can omit any one of <commit> , which has the same effect as using HEAD

How to create a patch for a whole directory to update it?

*爱你&永不变心* 提交于 2019-11-29 19:16:12
I know there are several threads on this already, but no one has fully explained exactly how to perform the initial diff to create the patch file, then how to apply that patch to the initial directory to update it. In my case, there is a directory of files that anyone can download from the web. I have taken that directory and made changes to it, and want to create a patch file such that others can apply it to the downloaded directory to reproduce exactly what I have in my modified directory. Help? What do I need to tell the other person with respect to how to apply my patch? David H I just had

Comparing two files in linux terminal

做~自己de王妃 提交于 2019-11-29 19:13:15
There are two files called "a.txt" and "b.txt" both have a list of words. Now I want to check which words are extra in "a.txt" and are not in "b.txt" . I need a efficient algorithm as I need to compare two dictionaries. if you have vim installed,try this: vimdiff file1 file2 or vim -d file1 file2 you will find it fantastic. Sort them and use comm : comm -23 <(sort a.txt) <(sort b.txt) comm compares (sorted) input files and by default outputs three columns: lines that are unique to a, lines that are unique to b, and lines that are present in both. By specifying -1 , -2 and/or -3 you can

Take diff of two vertical opened windows in Vim

感情迁移 提交于 2019-11-29 19:07:27
I've have two files opened. They are opened in vertical mode, next to next. Can I instantly diff these two files without leaving or closing Vim ? To begin diffing on all visible windows: :windo diffthis which executes :diffthis on each window. To end diff mode: :diffoff! (The ! makes diffoff apply to all windows of the current tab - it'd be nice if diffthis had the same feature, but it doesn't.) in each of the windows you want to diff type: :diffthis If you want to diff all of the open windows, you can do: :windo diffthis ( windo will apply the command to all open windows) Following up on the

Download Github pull request as unified diff

烈酒焚心 提交于 2019-11-29 19:03:47
How can I download the changes contained in a Github pull request as a unified diff? Simone Carletti To view a commit as a diff/patch file, just add .diff or .patch to the end of the URL, for example: https://github.com/weppos/whois/pull/90 https://github.com/weppos/whois/pull/90.diff https://github.com/weppos/whois/pull/90.patch Somewhat related, to let git download pull request 123 and patch it into mylocalbranch locally, run: git checkout -b mylocalbranch git pull origin pull/921/head To get the PR changes into your local repo in an staged but uncommitted state, so you can review: git pull

Difference between two directories in Linux [closed]

廉价感情. 提交于 2019-11-29 18:34:36
I'm trying to find the files existing in one directory but not in the other, I tried to use this command: diff -q dir1 dir2 The problem with the above command that it finds both the files in dir1 but not in dir2 as well as the files in dir2 but not in dir1 , I am trying to find the files in dir1 but not in dir2 only. Here's a small sample of what my data looks like dir1 dir2 dir3 1.txt 1.txt 1.txt 2.txt 3.txt 3.txt 5.txt 4.txt 5.txt 6.txt 7.txt 8.txt Another question on my mind is how can I find the files in dir1 but not in dir2 or dir3 in a single command? asclepix diff -r dir1 dir2 | grep

How to colorize diff on the command line?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 18:32:51
When I have a diff, how can I colorize it so that it looks good? I want it for the command line, so please no GUI solutions. kaji Man pages for diff suggest no solution for colorization from within itself. Please consider using colordiff . It's a wrapper around diff that produces the same output as diff, except that it augments the output using colored syntax highlighting to increase readability: diff old new | colordiff or just: colordiff old new Installation: Ubuntu/Debian: sudo apt-get install colordiff OS X: brew install colordiff or port install colordiff Use Vim : diff /path/to/a /path

Quickly find differences between two large text files

烈酒焚心 提交于 2019-11-29 18:23:00
问题 I have two 3GB text files, each file has around 80 million lines. And they share 99.9% identical lines (file A has 60,000 unique lines, file B has 80,000 unique lines). How can I quickly find those unique lines in two files? Is there any ready-to-use command line tools for this? I'm using Python but I guess it's less possible to find a efficient Pythonic method to load the files and compare. Any suggestions are appreciated. 回答1: If order matters, try the comm utility. If order doesn't matter,

Git diff on topic branch, excluding merge commits that happened in the meantime?

邮差的信 提交于 2019-11-29 17:27:03
问题 Let's say I have the following situation: B---D---F---G topic / / --A---C---E master For code review purposes, I would like to pull out a diff from commit A to commit G, but not including commits E and C which happened on the master branch, and also not including commit F which is a merge commit. In other words, I would like to generate a diff that contains changes from F to G and aggregate those changes with changes from A to D. In other-other words, I want the review diff to contain only my

Getting the old value and new value between two revisions with Hibernate Envers

ぐ巨炮叔叔 提交于 2019-11-29 16:44:49
This is a follow up question to Retrieve audited entities name, old value and new value of the given revision I have figured out how to get the two revision of an entity but don't see any easy to find the difference between the two. Is there anything in envers that will help doing a diff of an entity at different revisions? Or any good libraries? I would be really cool if I could get the property modified (_mod) field fields. So what I came up with to make life easier was to create an annotation to mark the fields I was interested in comparing. Without I ended up having to get with sticking to