|
|
Log in / Subscribe / Register

Git + launchpad

Git + launchpad

Posted May 6, 2015 8:55 UTC (Wed) by Flimm (guest, #98097)
In reply to: Git + launchpad by smurf
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).


to post comments

Git + launchpad

Posted May 6, 2015 9:37 UTC (Wed) by juliank (guest, #45896) [Link] (1 responses)

Right. git's job is managing your version history, not making backups of your working directory.

Git + launchpad

Posted May 6, 2015 11:09 UTC (Wed) by nye (guest, #51576) [Link]

>git's job is managing your version history, not making backups of your working directory

You say that as if those are clearly two different tasks, but reasonable people can disagree on that point.

Git + launchpad

Posted May 9, 2015 9:46 UTC (Sat) by Wol (subscriber, #4433) [Link] (2 responses)

> 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

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