git-diff

How to ignore directory on git diff --no-index?

不羁的心 提交于 2020-03-22 03:35:12
问题 I am trying to create a colorized diff between two folders in the same repository (This may be the totally wrong approach). I believe one way of achieving this is through git diff --no-index folder1 folder2 and it will automatically create a patch for you (Cool). However, the diff also includes (as one might expect), all of the .gitignore 'd files as well. folder1 node_modules src/ .gitignore package.json README.md folder2 node_modules src/ .gitignore package.json README.md I would like to

Is it possible to diff PowerPoint version-controlled with git?

旧街凉风 提交于 2020-02-18 05:19:31
问题 I have some PowerPoint documents that I keep version-controlled with git. I want to know what differences are between versions of a file. Text is most important, images and formatting not so much (at least not at this point). 回答1: I wrote this for use with git on the command-line (requires Python and the python-pptx library): """ Setup -- Add these lines to the following files: --- .gitattributes *.pptx diff=pptx --- .gitconfig (or repo\.git\config or your_user_home\.gitconfig) (change the

How to git-apply a git word diff

不羁岁月 提交于 2020-02-15 07:24:56
问题 I needed to edit a messy commit commit that only changed a word in a few subsequent rows, keeping some of those changes and removing others. The changes were easy to see in git diff --word-diff , and in that format I could easily edit the hunks to do what I intended to do, but now I have a file like this diff --git a/cldf/forms.csv b/cldf/forms.csv index 46c12a4..0374ece 100644 --- a/cldf/forms.csv +++ b/cldf/forms.csv @@ -1783,8 +1783,8 @@ ID,Lect_ID,Concept_ID,Form_according_to_Source,Form

How to git-apply a git word diff

牧云@^-^@ 提交于 2020-02-15 07:24:49
问题 I needed to edit a messy commit commit that only changed a word in a few subsequent rows, keeping some of those changes and removing others. The changes were easy to see in git diff --word-diff , and in that format I could easily edit the hunks to do what I intended to do, but now I have a file like this diff --git a/cldf/forms.csv b/cldf/forms.csv index 46c12a4..0374ece 100644 --- a/cldf/forms.csv +++ b/cldf/forms.csv @@ -1783,8 +1783,8 @@ ID,Lect_ID,Concept_ID,Form_according_to_Source,Form

How to git-apply a git word diff

杀马特。学长 韩版系。学妹 提交于 2020-02-15 07:23:49
问题 I needed to edit a messy commit commit that only changed a word in a few subsequent rows, keeping some of those changes and removing others. The changes were easy to see in git diff --word-diff , and in that format I could easily edit the hunks to do what I intended to do, but now I have a file like this diff --git a/cldf/forms.csv b/cldf/forms.csv index 46c12a4..0374ece 100644 --- a/cldf/forms.csv +++ b/cldf/forms.csv @@ -1783,8 +1783,8 @@ ID,Lect_ID,Concept_ID,Form_according_to_Source,Form

How to git-apply a git word diff

本小妞迷上赌 提交于 2020-02-15 07:22:51
问题 I needed to edit a messy commit commit that only changed a word in a few subsequent rows, keeping some of those changes and removing others. The changes were easy to see in git diff --word-diff , and in that format I could easily edit the hunks to do what I intended to do, but now I have a file like this diff --git a/cldf/forms.csv b/cldf/forms.csv index 46c12a4..0374ece 100644 --- a/cldf/forms.csv +++ b/cldf/forms.csv @@ -1783,8 +1783,8 @@ ID,Lect_ID,Concept_ID,Form_according_to_Source,Form

Showing which files that match a specific pattern have changed between git branches

旧时模样 提交于 2020-01-30 11:41:34
问题 I want to merge two branches but before, I'd like to review the changes between the two branches on all files whose filename ends with .twig . Is it possible, or should I use some bash-magic like git diff --name-only branch1..branch2 | grep .twig ? 回答1: You can pass the file names to git diff after a --, so: git diff --name-only branch1..branch2 -- '*.twig' Should do what you want. I put *.twig in single quotes so the shell won't expand it. 来源: https://stackoverflow.com/questions/17215172

Configuring multiple git mergetool and difftool so that appropriate tool will be chosen based on extension

断了今生、忘了曾经 提交于 2020-01-25 03:50:10
问题 When I do git difftool, recursively it runs default difftool for all files. I wrote a script to choose appropriate difftool based on extension and I call like git difftool -t mytool in the script. difftool redirects all arguments to new call, which is good. However, it somehow redirects all file names as well. So basically, my script becomes useless since custom difftool is passed with all files that is changed. What I want to do is, limit difftool to one file, or at least call my diftool

Understanding git diff on files [duplicate]

心不动则不痛 提交于 2020-01-11 07:55:11
问题 This question already has answers here : What does the “@@…@@” meta line with at signs in svn diff or git diff mean? (3 answers) Closed 6 years ago . What does the folowing output of git diff mean? diff --git a/README.md b/README.md index 24aa464..49c20f4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ LINE1 -LINE2 LINE3 I think I understand that the "-" new LINE2 means that the version on have in workspace does not have the LINE2 that is in staging, but what does @@ -1,3 +1,2 @@ mean?

How do I view a git diff in a text editor?

一世执手 提交于 2020-01-05 04:11:07
问题 How do I view a git diff in a plain old text editor like Atom? I don't want to set up or use a diff tool, I just want to view the diff in any basic text editor. Answers to other questions I've seen talk about setting up a diff tool, but I just want to specify some random text editor. Side question: What's the difference between a diff tool and any text editor? 回答1: How do I view a git diff in a plain old text editor like Atom? I don't want to set up or use a diff tool, I just want to view the