Complete the command to show the SHA-1 hash of a file named example.txt.
git hash-object [1]The command git hash-object example.txt calculates the SHA-1 hash of the file example.txt.
Complete the command to create a new Git object from the file data.txt and print its SHA-1 hash.
git hash-object -[1] data.txt-r which is not a valid option here.-c or -m which are unrelated.The -w option writes the object into the Git database and prints its SHA-1 hash.
Fix the error in the command to get the SHA-1 hash of file.txt by filling the blank.
git hash-object [1] file.txt-r which is invalid here.--stdin which expects input from standard input.The correct option to write the object and get its SHA-1 hash is -w. The others cause errors or do not produce the hash.
Fill both blanks to create a SHA-1 hash of README.md and store it in the Git database.
git hash-object [1] [2]
file.txt.-r instead of -w.The -w option writes the object, and README.md is the file to hash.
Fill all three blanks to create a SHA-1 hash of script.sh, write it to the Git database, and then display the hash.
hash=$([1] [2] [3]) && echo $hash
-r instead of -w.The command hash=$(git hash-object -w script.sh) writes the object and returns the SHA-1 hash, which is stored in hash and then printed.