I'm using the github windows shell and I'll do the following
git status
see a list of modified files and want to remind myself what's changed. I'll have to type something like
git diff Source\FooBar\Pages\FooBar.aspx
That seems like a lot of characters to have to type. Is there some easier workflow to look at diffs that I'm not seeing?
The git diff command returns a list of all the changes in all the files between our last commit and our current repository. If you want to retrieve the changes made to a specific file in a repository, you can specify that file as a third parameter.
The git diff command is used to perform the diff function on Git data sources. For example, commits, branches, files, and so on. It can also be used to compare two files of different branches.
While in git diff , simply hit n to go straight to the next file, and again to the one afterwards, and so on. You can also use N to go back a file. (For these commands to work, you'll need to first type /^diff and press Enter , as explained in this answer.) Pressing n finds the next search term.
Comparing changes with git diffDiffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.
git diff -- **/FooBar.aspx
In general *
stands for any part of a filename while **
stands for any subpath. E.g. git diff -- **/main/**/*.aspx
will diff only aspx
files that are residing somewhere in a subdirectory of main
or main
itself. This applies to other commands that accept paths, like commit and add.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With