GIT SHA id of a file on remote git branch
I would like to know if there is any command available to get the SHA id of a parti开发者_如何学编程cular file on a given specific git branch on the GIT remote server?
Thanks, Srinivas
git lsremote is one of the few commands running against a remote repo, as explained in "Show git logs for range of commits on remote server?".
But it will only display SHA1 on refs (tags, branches, ...), not a specific file.
For a file, you need first to fetch the remote repo, and then you can query your information on a specific file.
Thanks for the reply..
I got below command working to meet my scenario for now.. but trying to see if there is any direct command to find the latest ID of a file on remote server...
git log 'branch-name' -- 'file-name'
which displaying log messages with ID, Author and Date.. I am fetching the top first line with unix pipe head command.
git log 'branch-name' -- 'file-name' | head -1
精彩评论