Git Practice
Git Practice
file1.txt
file2.txt
file1.txt
file2.txt
file1.txt
file1.txt
Case-1: To see the difference in File Content between Working Directory and staging Area
Case-2: To see the difference in File Content between Working Directory and Last Commit
It shows the differences between working copy and last commit copy.
Case-3: To see the difference in File Content between staged Copy and Last Commit
It shows the differences between staged copy and last commit copy.
Here HEAD is optional. Hence the following 2 commands will produce same output
Case-4: To see the difference in File Content between specific Commit and Working Directory Copy
6745461 (HEAD -> master) 2 files and each file contains 4 lines
Eg:
Case-5: To see the difference in file content between specific commit and staging area copy:
--- a/file1.txt
+++ b/file1.txt
6745461 (HEAD -> master) 2 files and each file contains 4 lines
$ cat file1.txt
first line in file1.txt
second line in file1.txt
Note: git checkout is applicable only for the files which are
already tracked by git. It is not applicable for new files.