git-diff

git diff, shows the same line as both deleted and added

时光毁灭记忆、已成空白 提交于 2019-12-09 07:38:16
问题 I accidently worked on the master where I had to open up a new branch. I reverted it to its original form almost completely. At one class I get the following diff that I can not make sense out of. index 4a9abb8..7c55879 100755 --- a/includes/site.inc.php +++ b/includes/site.inc.php @@ -142,11 +142,11 @@ class site{ public $tplEngine = 'smarty'; - + private $_productsByType = array(); private $logger; - protected $locale = 'tr_TR'; - + protected $locale = 'tr_TR'; + It says that I have deleted

(git) diff output relative path?

我与影子孤独终老i 提交于 2019-12-08 15:26:54
问题 I need to get some diffs in my repo that are not relative to the base of the repo, but instead relative to a given base or given path. By default I get: git diff diff --git a/path/to/file b/path/to/file index 0cc125e..9bf911e 100644 --- a/path/to/file +++ b/path/to/file But what I want is something like: git diff --prefix=/new/path/to diff --git a/new/path/to/file b/new/path/to/file index 0cc125e..9bf911e 100644 --- a/new/path/to/file +++ b/new/path/to/file I have looked over the --relative

Is git difftool on binaries possible? If so, how does one configure it?

和自甴很熟 提交于 2019-12-08 05:52:26
问题 I've been following guides like these here and here on how to diff binaries in git - more specifically .odt files and microsoft word files. They have allowed me to $git diff <commit> on .odt files and microsoft word files to display the difference in the terminal; however their methods don't seem to work with $git difftool <commit> on binary files, such as .odt files or .docx files. Ideally I would like to display the text diff of .odt files or .docx files in an external program such as

How to perform a 3-way visual diff on git?

蓝咒 提交于 2019-12-08 05:17:13
问题 I'd like to do a 3-way diff of a single file that exist in 2 different branches, that is, the last commit in each branch and also consider the common ancestor. I want to use an external tool that allows to do 3-way comparison. I was considering to use git difftool but as far as I could see it only allows comparing any 2 versions of a given file. I could use mergetool but that forces me to run git merge first so that, BASE, REMOTE and LOCAL variables are set. I don't want to run git merge. I

What differences are in the patches/files created by diff and git diff?

喜欢而已 提交于 2019-12-08 04:50:28
问题 I wonder what differences are in the format of the files/patches created by diff and git-diff . I know in diff there are 3 (the "normal", the "compact" -c one and the "unified" -u one). However there may be some differences and in some situations you cannot freely exchange git diff and diff . So: On what does it depend whether you can use git diff and diff for the same file? And what are the differences between the formats? If you cannot exchange the commands (see 1.) how can you convert the

Need to get all file differences (added, modified, renamed) between two Git commits

喜你入骨 提交于 2019-12-08 03:03:23
I'm trying to export all files with differences between two commits, those differences being: New files (Added) Modified files Renamed files If possible, information on any deleted files Detecting renames may be a tough one as I will be doing the exporting on a Windows 7 environment and hence somefile.php is the same as SomeFile.php ; but I will be uploading them to a *nix environment, which does treat those files as being different, so they are needed to be recognized and exported if possible. I was using the below command: git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $head

How to find out what files were changed in a git branch (not the difference between two branches)

匆匆过客 提交于 2019-12-08 00:20:49
问题 I have a branch named feature_219 which was created from master a little while ago. Since the diversion, there were a number of files changed on both the branches. Now I am trying to figure out what files where changed while working on the feature_219 branch only. After doing some research I found out that git diff --name-only master feature_219 might help but it turned out that this commands tells about all files that are different in both the branches. I tried to look for some option with

In git how to diff microsoft word documents?

∥☆過路亽.° 提交于 2019-12-08 00:06:57
问题 I've been following this guide here on how to diff Microsoft Word documents, but I ran into this error: Usage: /usr/bin/docx2txt.pl [infile.docx|-|-h] [outfile.txt|-] /usr/bin/docx2txt.pl < infile.docx /usr/bin/docx2txt.pl < infile.docx > outfile.txt In second usage, output is dumped on STDOUT. Use '-h' as the first argument to get this usage information. Use '-' as the infile name to read the docx file from STDIN. Use '-' as the outfile name to dump the text on STDOUT. Output is saved in

Git diff fails on file with underscore in path

≡放荡痞女 提交于 2019-12-07 16:13:57
问题 I'm running Windows 7, and I have the latest version of git (2.7.2.windows.1). I previously used Windows PowerShell as my terminal for git operations, with no issues. Recently, I decided to switch to Git Bash, but I'm having one major issue. My project has a directory (within which are many subdirectories) whose name is simply an underscore. Whenever I try to run git diff on a file within that directory, I get the following error: $ git diff _/css/templates/jquery.tag-editor.css fatal:

Using a different application to colourize diff output in git

余生颓废 提交于 2019-12-07 11:38:51
问题 I want to use cdiff to colourize my diff output when using git. I could pass the output from git commands through cdiff, but I'd like to know if it's possible to not have to do this. Specifically, when I use git log -p , I want it to use cdiff to colourize the output, when I use git commit -p , I want it to use cdiff to colourize the output. I'd like to tell git to not do the colouring itself, and to instead use this extra programme. How do I do this? 回答1: From what I can see, git produces