37
fyzrn
7y

Commit fast, commit often.

I lost a day's worth of code once, because I wanted to commit all of them in the evening right before I was to go home. Then I mistakenly hit `git checkout .` instead of `git add .`.

Poof. Gone.

Comments
  • 3
    You cant check out with uncommitted changes
  • 1
    @Kimmax you can check out a file. Which means the unstaged changed gets deleted.
  • 5
    @purpletoxicrain uhh I missed the point (hehe)
  • 2
    @Kimmax that's a bit punny...
  • 2
    I approve this. Small git commits and to the point. Also your commit message should be readable. Have you seen Slack release notes? Like that.
  • 1
    Never use `.`
    Ever.
  • 1
    Intellij's local history for the rescue
  • 1
    @Ashkin
    Edit: well, you can, but be very sure what you're doing. And if you're new to git, my above advice stands.
  • 0
    @Ashkin yeah, I rarely use that, even when I do, it's only when I'm committing every a few changes. I guess my brain just snapped that day lol
Add Comment