In Windows, in Git Bash, if I do a git diff I get all the differences flushed to the console with some sort of prompt to control the output buffer. What are the commands I can use in this mode of Git Bash? I don't know where to look for a quick reference.
I've worked out that <Enter>
will scroll one line, and <Space>
will scroll all lines, but not much more than that. To quit I do a Ctrl-C, which seems to go back to a command prompt, but then sometimes when I start typing a new command it seems to go back to the unfinished diff output and I'm confused as to why.
Really dumb question, I know.
You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.
git diff --cached --merge-base A is equivalent to git diff --cached $(git merge-base A HEAD) . This form is to view the changes you have in your working tree relative to the named <commit>. You can use HEAD to compare it with the latest commit, or a branch name to compare with the tip of a different branch.
Launch Git Bash console by clicking on the Start button, type git, and click on Git Bash. 2. Run the below git config command to add your name ( YourName ) as your git username ( user.name ). The git config command administers configuration variables that control how Git looks and operates.
git diff
pipes the diff file into the Unix less
pager. Press h
when the diff view is open to see a bunch of commands. The particularly important ones to know:
h
- Display help/commandsq
- Quit/close[Space]
scroll 'k' lines ahead, where k should default to your terminal's line display height.[Enter]
scroll 'k' lines ahead, where k defaults to 1If 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