You are viewing a single thread.
View all comments
24 points

If you’re using reset with uncommitted changes and you’re not intentionally throwing them away, you’re doing something wrong. git reset —hard means “fuck everything, set the state to X”. I only ever use it when I want to throw away the current state.

permalink
report
reply
5 points

Well yeah I think the point is you’re human and you might make a mistake.

permalink
report
parent
reply
5 points

Let me live with my mistakes

permalink
report
parent
reply
0 points
*

Waddyamean “that’s what backups are for” Sorry, wrong community

permalink
report
parent
reply
3 points

Not many people back up continuously, so this is still useful.

permalink
report
parent
reply
6 points

Using git reset --keep would just make more work since I’ll have to throw away uncommitted changes anyways. Removing uncommitted changes is kind of the whole point, it is called ‘reset’ after all. If I want to preserve uncommitted changes, I’ll either stash them or commit them to a temporary branch. That has the added benefit of adding those changes to the reflog so if I screw up later I’ll be able to recover them.

permalink
report
parent
reply

Git

!git@programming.dev

Create post

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

Community stats

  • 217

    Monthly active users

  • 69

    Posts

  • 156

    Comments