Recently, I started to touch git. Learning to Git diff is always confusing. Git diff compares the difference between the two files. After searching the net on the net, finally found Le answer.
There are two cases, one is when there are files in staging area, and the other i
In practice, by using Git diff to calculate the number of code changes, there is a need to just count certain types of files (files with special suffix names/extensions), such as: Only the variables for files in the current git repo. java,. xml,. c,. cpp. There are two ways to make git count according to the file suffi
This article was reproduced from: Https://www.jianshu.com/p/e5d801b936b6Premise:
Generate Patch: git format-patch-m master generates the specified patch, 0163BED3BF59AE74C36CC5138B4C24F1556D8304 is a commit id,-1 is the start of the current ID, the number of commits down, including this and the count starting from 1. that is, I want to 0163bed3bf59ae74c36cc5138b4c24f1556d8304 the current patch, then:
It can be helpful to see the changes between the sets of code; git difflets us do this by comparing the Git references and outputting the differences between them. In this lesson, we show how to use git diff along with --stat the,,, --cached HEAD origin/master file(s)/dir(s) options.If you want to see the difference be
The output of Git diff is not the same under the action of different parameters. After understanding the workspace in Git, the latest version of staging area and the repository (current branch) is three different tree directories, which is a good understanding of Git diff's magical behavior.Directory tree browsing for
Book on the last, straight into the theme. If you follow the previous article, run git reset head test.txt and git checkout test.txt to discard the current changes so that the latest commit goes back to "commit temp," which runs git status and sees " Nothing to commit, working directory clean ". Here, "nothing to commit" indicates that the staging directory is em
The book is connected to the last, straight into the subject. If you're on the next page, run git reset HEAD test.txt and git checkout test.txt to discard the current changes and get the latest commit back to "commit temp", run git status and see " Nothing to commit, working directory clean ". Here, "nothing to commit" indicates that the staging directory is empt
Usage of git diffThere are three major parts of the Git commit: Working tree, index file, commitof these three parts: Working tree:Is the directory you work in, and whenever you make changes in your code, the state of the working tree changes.Index file: is a working tree and commit bridge, and whenever we use the Git-add command to register, the content of the i
Using Git in Windows, msysgit is the first choice, but the shell of msysgit is not powerful, the size cannot be changed, and the font is ugly. Therefore, in Windows, using Git in Cygwin is a good choice.
Before submitting the code, or merging the code to view the code modification, we often need to diff to see what changes are there, and the
One of the first real points of frustration a developer encounters with git is the initial unresolved merge conflict.
Beyond compare is an excellent file Comparison Utility and can be configured with git as a merge and diff tool. to Setup diff on Linux, create a short wrapper script to pass the parameters in the correc
. Similarly, "+1,7" means that after a change, the second file becomes a row of 7 lines starting from line 1th.The third part is the concrete content of the change.
AAA-A+bAAA
In addition to those rows that have changed, the context displays 3 rows. It merges the context of two files together, so it's called "Merge format." The first flag bit of each line, empty represents no change, minus indicates the row that the file was deleted from, and the plus sign represents the new row fo
1. Install the meld graphical ToolGit difftool and git mergetool are git commands dedicated to providing diff and merge with our own tools.You only need to configure it:
Git config -- Global diff. Tool meld # configure the default difftoolGit config -- Global merge. Tool me
Merge_result6 7 "C:\Program Files\sourcegear\common\diffmerge\sgdm.exe"" $"" $"" $"--result="$4"--title1="Mine"--title2="Merge"--title3="Theirs"Note: The path name is the actual pathname of the installed DiffMerge.exe, and the landlord is "C:/Program Files/sourcegear/common/diffmerge/sgdm.exe"(2) Set the \CMD environment variable, easy to findThe Git program's cmd directory is added to the environment variable path, the landlord's "C:\Program Files\
The odt file is actually made up of several text files, and git can support diff with some configuration. Step 1: In the GIT project I add the. gitattributes file with the following content: *.odt Diff=odtstep 2: Add the following paragraph to the. git/config file: [
First git log to view the commit ID, record the ID of the patch you want to hit,
such as:
git log
commit 4ff35d800fa62123a28b7bda2a04e749addf1918
Author:chenfulin5
SVN diff uses Vimdiff as an article description of the comparison diff tool referenceOne of the Vim's nice features are a powerful diff tool that can being used to easily tell the differences between multiple differ ent files. This can is called up at any time by issuing the following:
Vimdiff file1.xxx file2.xxx
Subversion ' s default
: Git status View changes to files in the local workspace, registers
For the use of Git diff and git add commands, please refer to the article: Git Usage manual: Git diff,
@@
The preceding " -1,7″" is divided into three parts: The minus sign represents the first file (i.e. F1), "1″ represents line 1th," 7″ indicates 7 consecutive rows. Together, it means that the first file is 7 consecutive lines starting at line 1th. Similarly, "+1,7″ represents a change, and becomes the second file 7 consecutive lines starting at line 1th."
The third part is the concrete content of the change.
AAA-A+bAAA
In addition to the rows that have changed, the context shows 3 rows ea
of the change.
AAA-A+bAAA
In addition to those rows that have changed, the context displays 3 rows. It merges the context of two files together, so it's called "Merge format." The first flag bit of each line, empty represents no change, minus indicates the row that the file was deleted from, and the plus sign represents the new row for the second file.Six, the Git format diffVersion management system
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.