git-diff

Compare old and new versions of force-pushed GitHub pull request

孤者浪人 提交于 2019-12-03 08:31:15
问题 Frequently, my colleagues will make some changes to an open pull request, rebase their local branch against the base branch - often squashing their changes into previous commits as well - and force-push. How can I see what changed between the old version of the PR and the new version of the PR? I guess I could do a git pull and git checkout $BRANCH_NAME when the PR was first raised, then git fetch and then git diff $BRANCH_NAME..origin/$BRANCH_NAME after the PR was updated - but that will

git diff sees whole file as changed when it's not [duplicate]

五迷三道 提交于 2019-12-03 05:25:43
问题 This question already has answers here : diff returning entire file for identical files (3 answers) Closed 5 years ago . The git diff engine is seeing a whole file as changed when it has not. For example, take this commit: https://github.com/etiago/phpvirtualbox/commit/626e09958384f479f94011ac3b8301bd497aec51 Here we see that the file lib/vboxconnector.php has 2807 additions and 2778 deletions. Additionally, from doing a manual git diff I find that indeed, the whole file is taken in as a

git log -p vs. git show vs. git diff

余生颓废 提交于 2019-12-03 04:19:32
问题 How are the commands git log -p , git show , and git diff related and why would one be used over another? Given a repo with the following 4 commits: commitd - last commit commitc commitb coomita - initial commit What are the differences between the following git commands?: git log -p commitb commitd git show commitb commitd git diff commitb commitd git log -p commitd commitb git show commitd commitb git diff commitd commitb git log -p commitb..commitd git show commitb..commitd git diff

Set UTF-8 display for Git GUI differences window

别来无恙 提交于 2019-12-03 04:14:11
问题 I can't remember how I made Git GUI to display UTF-8 encoded differences correctly. Also I can't find the guide in search engines. Now I need to do this at new workplace. Could you write down instructions? OS: Windows 7 回答1: # Global setting for all you repositories > git config --global gui.encoding utf-8 # For one repository only > git config gui.encoding utf-8 Or from the GUI window: Edit -> Options... -> Default File Contents Encoding -> Change and select "Unicode (UTF-8)" In the Options,

git: Why doesn't git diff show any differences?

谁都会走 提交于 2019-12-03 04:12:52
If I run 'git status' on my repo it gives: # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: myfile However, if I do a 'git diff myfile' it shows no differences. Is this because I have made a change and removed it so it is back to the original? Should I run 'git checkout myfile' to clear it? Your file is already staged to be committed. You can show it's diff using the --cached option of git. git diff --cached myfile To unstage it, just do what git status suggests in it's output ;) You can check The Git Index For more info. I have a

“git diff” does nothing

拈花ヽ惹草 提交于 2019-12-03 02:53:56
问题 I presume this is a configuration error somewhere, but I can't figure out where. Regular git commands appear to work fine, but "git diff" does nothing. To be safe, I removed external diff tools from my .gitconfig file. This was installed via MacPorts and is the lates version (1.7.2.2). What I see is that when I run "git diff" from my workspace, it simply exits, doing nothing. $ git --version git version 1.7.2.2 $ git diff $ If I back up one directory, out of my root workspace, typing "git

Can TortoiseMerge be used as a difftool with Windows Git Bash?

前提是你 提交于 2019-12-03 02:36:34
问题 I'm just starting to work with Git. I would like to use TortoiseMerge as the difftool and mergetool. In my .gtconfig in my personal user directory I have the following sections. I've removed the user and color sections for this question. [merge] tool = tortoisemerge [mergetool "tortoisemerge"] cmd = \"TortoiseMerge.exe\" -base:\"$BASE\" -mine:\"$LOCAL\" -theirs:\"$REMOTE\" -merged:\"$MERGED\" [diff] tool = tortoisemerge [difftool "tortoisemerge"] cmd = \"TortoiseMerge.exe\" -base:\"$BASE\"

How to get git diff with full context?

隐身守侯 提交于 2019-12-03 02:06:36
问题 How to create patch suitable for reviewing in crucible? git diff branch master --no-prefix > patch This generates only 3 lines of context. So I do the following git diff --unified=2000 branch master --no-prefix > patch Hopefully all files will have less than 2000 lines. Is there a way to tell git to include all the lines in the file for patch without having to specify maximum lines? 回答1: I know this is old, but I also dislike hard-coded solutions, so I tested this: git diff -U$(wc -l MYFILE)

git show commit in beyond compare

允我心安 提交于 2019-12-03 01:26:20
I would like to see a specific commit in Beyond Compare or any other separate diff tool while viewing it via git show . I tried looking at help of git show/difftool/config but couldn't find anything. Does anyone know how it can be done? I've looked at Git Diff with Beyond Compare and configured Beyond Compare for git difftool but I also want to use it as tool from git show I managed to use git difftool to see commits that I normally used to see via git show . git show $commit translates to git difftool $commit^ $commit . The above command shows difference between commit's parent ($commit^) and

How to Diff between local uncommitted changes and origin

a 夏天 提交于 2019-12-03 00:18:44
问题 Let's say I cloned a repository and started modifying files. I know that if I have local uncommitted changes, I can do a diff as follows git diff test.txt and it will show me the difference between the current local HEAD and the modified, uncommitted changes in the file. If I commit those changes I can diff it against the original repository by using git diff master origin/master But is there any way of diff'ing the local changes with the original repository on the server before committing