|
|
Log in / Subscribe / Register

Git + launchpad

Git + launchpad

Posted May 9, 2015 9:46 UTC (Sat) by Wol (subscriber, #4433)
In reply to: Git + launchpad by Flimm
Parent article: Git code hosting beta (launchpadblog)

> You can't undo git checkout -- filename or git reset --hard commit, whereas you can do that in Bazaar (it creates a hidden backup file every time).

As has been pointed out, git DOES NOT delete anything unless you try very hard to make it. So "git reset --hard commit" should be easy to undo - "git reset --hard oldhead".

As for "git checkout -- filename", well I guess the old filename was never in git, so how can git recover it?

Cheers,
Wol


to post comments

Git + launchpad

Posted May 9, 2015 14:33 UTC (Sat) by madscientist (subscriber, #16861) [Link] (1 responses)

I think Flimm is talking about modified files; if you run git reset --hard then all modified files are reset and the modifications are not saved anywhere. Apparently bzr will make a hidden backup copy of modified files.

In Git, you need to first run "git stash" or similar to keep a backup of modified files.

Git + launchpad

Posted May 16, 2015 6:46 UTC (Sat) by zenaan (guest, #3778) [Link]

And "git stash" can be simply added to a checkout hook, for the paranoid, for those for whom that risk is too great, it is easy to configure that pain away...


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds