10
emilews
5y

So, I'm working on some stuff, Bitcoin Cash related. And you see, I feel I'm actually doing so much progress, and that's good. The thing is that I always forget to commit and I end up commiting and pushing like 5 or more changes on 5 or more files that are literally not related.
I feel stupid

Comments
  • 3
    that is just normal sometimes.

    to break it down into cleaner commits, you can do this:

    instead of commiting, run git stash, which will save your current changes.

    then, you try to code again the changes that you did, but organized into one commit at a time.

    (it is likely that you'll find easier to make these simpler commits one by one this 2nd time)

    when you're finished, you run git stash apply, to compare with what you did the first time.

    in the best case of the stash apply, it changes nothing.
    otherwise, you may find that the rewrite is better or that you forgot something.
  • 1
    It just happens. You just to have write code keeping commits in mind. Sometimes it is too much, sometimes it is the best approach
Add Comment