DEV Community

Discussion on: Time traveling with Git Reflog

Collapse
 
xtofl profile image
xtofl

Thanks for writing about this! I to use it very often, because I like a nice git log. I'm cleaning up, git commit --fixup-ping, --amend-ing, rebase -i-ing all the time. Like you, I discovered that fear is not needed when using git: there is always a memory lying around of what you created (if not on your harddrive, then on the one of your teammate who pulled three hours ago).

Ideally, force pushes are not recommended but when you rewrite your history (knowingly), this leaves us with this only option.

I highly recommend using force-pushes: they are useful if you want to use your git log as a recipe instead of as a personal work history

  • want to keep your history useful (I mean, after a month or so)
  • want to continuously share your work with your team

BUT! you can't do it without good communication. (Lest the communication will be from your team towards you, and contain swear words).

Collapse
 
thebuildguy profile image
Tulsi Prasad • Edited

Really good post there!

Both work log and recipes have their down and upsides. I think if you follow a recipe standpoint you can be removing some essential points in your repo which fixed a bug let's say, and all of it when made recipe will just be enough to give an overview of what's the bigger picture.

However, I'd be forced to use recipe method when working in a huge team when everyone has their minuscule commits of changes which can spoil the mainline strucutre. Also adding more semantics to commits are appreciated!

Thanks for stopping by! Glad you liked my post!