![]() ![]() Tested it a little, needs more testing.īy adding the -p option to that command, git shows much more detailed for the one file you’re looking at: it shows the patches for each git commit (log entry). $ git log -p # detail about each “patch”Īs shown in the comment, the git log command by itself shows date, time, and the git commit message information for each commit/patch:Ĭommit 1152687d48d716ec8ca3871e0d2f9009302c69f7Īdded Kofi ad/image back to the upper-leftĬommit cf3cfc2ab066197ed6124754d1ee33939aa5cf5a There are at least two other git history/log/patch commands you can use to show the history of commits for a file: > git diff -cached src/main/scala/agt/Main.scalaĪs a quick recap, if you want to see the changes to one or more Git files that have been added but not committed, this git diff command shows a solution for that. You can also show the changes to just one file by adding the filename to the end of the command: That command shows every file that has been added but not committed, but each block of output begins with the filename, which is very helpful. This shows that I added that comment just above the shiftTypeKeycode method. ![]() Private def shiftTypeKeycode(keycode: Int): Unit = + // TODO: rename to just `shift` and make it public? So I ran that command and saw this output:ĭiff -git a/src/main/scala/agt/Main.scala b/src/main/scala/agt/Main.scala and then git status and saw that I changed three files, but I couldn’t remember what I did to the src/main/scala/agt/Main.scala file. If you have modified some files in a Git repository and did a git add on them, but haven’t yet done a git commit on them, you can view those changes with this command:įor example, I just ran git add. $ git log -p -follow - > the_history.log Show git changes that has been added but not committed Note that you can also output this git history information to a file like this: +++ -1,30 +1,12 Boolean, adUpperLhsContent: String)Īgain, that git command shows every historical change to that file, and can easily result in hundreds or thousands of lines of detailed output for a file. ![]() LHS ad code is now in properties file (v28)ĭiff -git a/src/main/twirl/ b/src/main/twirl/ -follow tells git to also show information in the event a file has been renamedĪs an example, when I use that command on this file, I see several hundred lines of output that show me every line that has been added and removed from this file:.Solution: When you want the detailed git commit history for a file, this is the best git command I know: Git FAQ: How do I view the detailed commit history for a file with git? ![]()
0 Comments
Leave a Reply. |