Git - finding a filename from a SHA1

前端 未结 5 1767
广开言路
广开言路 2020-11-27 13:56

I added a file to the index with:

git add somefile.txt

I then got the SHA1 for this file with:

git hash-object somefile.txt         


        
5条回答
  •  攒了一身酷
    2020-11-27 14:44

    Commit the file and note the sha1 hash of the commit object. After that use

    git ls-tree 
    

    and you will get the names of the files with the hashes.

    Check the manual pages for more options.

提交回复
热议问题