Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would you actually do that? It's information destruction. You can machine generate at any time, but you can only delete the human input once


> you can only delete the human input once

    git branch "backup/$(git branch --show-current)/$(date +%s)"
    # do whatever you fancy
    git reset --hard "backup/$(git branch --show-current)/${thattimestampabove}"
You can't lose anything as long as you have a pointer to it (which doubles as making it easy to find)


No need to make a "backup" branch. Learn to trust the reflog.


That is like learn to trust the indestructibility of matter. I can still lose (not able to locate...) my keys even though they still exist!


reflog doesn't keep things through gc.

the only thing that does keep a git object is having a ref that (directly or transitively) points to it


My human inputs are usually commit messages like "awdjhwahdwadga" until I do the rebase at the end


? I assume you want to replace your jubberish messages with something more useful before pushing? It is only "destroying" https://xkcd.com/1296/ style crap? Code changes stay the same.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: