How can I call git diff in the same file between two different local branches?

Is there a way to check the difference between the working directory in my current branch and the working directory of another branch in a specific file? For example, if I work in branch A in file 1, I want to compare the difference with file 1 on branch B.

+4
source share
2 answers

Use the syntax for the git diff branch file name:

git diff branchA branchB -- file.cs

enter two names of your branches and, optionally, use the parameter -- filenameto specify one file! Good luck let me know if you have a problem.

+11
source

, , legacy, build.gradle master:

git diff master build.gradle

+3

Source: https://habr.com/ru/post/1649567/


All Articles