git - How to get the SHA of commit from diff output? -


how can sha of commit diff output?

for example diff binary file, output of git show commit is:

diff --git a/0_prospektusok/far_feltetdiszek/feltetdisz_prospektus.xls b/0_prosp index 9993010..707c169 100644 binary files a/0_prospektusok/far_feltetdiszek/feltetdisz_prospektus.xls , b/0 

the git show 9993010 shows file on terminal, if redirecting file , opening ms excel, contains junk.

the git checkout 9993010 says fatal: reference not tree: 9993010.

how can checkout versions of a , b?

if want checkout whole repo before commit use git checkout commit~.
if want keep working copy , update file state had before commit, use git checkout commit~ -- 0_prospektusok/far_feltetdiszek/feltetdisz_prospektus.xls.
explanation why git checkout 9993010 didn't work, read answer how "index f2e4113..d4b9bfc 100644" in git diff correspond sha1 id in gitk?


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -