Hacker News new | past | comments | ask | show | jobs | submit login

They are wrong, there are actions you can take in git that will cause you to lose your "immutable" history. Most accidental cases probably involve `git reset` or `git rebase`, but here's an example if you want to do it intentionally:

    # Commit all changes and push to at least one remote so your changes are ""immutable""
    rm -rf myrepo/
    mkdir example && cd example
    git init
    # Repeat for each remote
    git remote add remote1 https://origin.for/your/repo
    git push remote1 --mirror --force
Congrats, you've lost everything! (Except for your backups, you do have backups right?)



`git reset` and `git rebase` will not lose anything that you have commited before. And force-deleting the remote stored repo is cheating (and prevented by default in quite a few services).


No, you're wrong. Study more. There are a ton of resources out there on how git works.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: