My quandary: I want to retrieve a copy of an element from a previous commit.

I don't want to replace the current element with the previous commit level.

What I want to do is to get a copy to review of the element from a previous
commit without impacting in anyway the current repository.

I've tried: git show <hash>:<file> > /tmp/file

And it works GREAT for text based elements. For binary elements the results
are useless.

I thought of:

1.      doing a checkout to revert the current element, making a copy, then
undoing the checkout (but I really don't want to leave things in a
potentially corrupt state should something happen before the undo) using:
git checkout <hash>, then cp of the element somewhere, then git checkout
master.
2.      Making a copy of the repo and doing a checkout to the previous
commit and then copying the element before removing the temporary repo copy

Both have drawbacks and seem overkill.

Any advice would be greatly appreciated.

 

Lionel B. Dyck <sdg><
Website:  <https://www.lbdsoftware.com> https://www.lbdsoftware.com

"Worry more about your character than your reputation.  Character is what
you are, reputation merely what others think you are." - John Wooden

 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/05a001d65c36%24595e4cf0%240c1ae6d0%24%40gmail.com.

Reply via email to