git diff> & apply vs stash

nirlanka

Nir Lanka ニル

Posted on June 3, 2020

git diff> & apply vs stash

I never use git stash and prefer to use git diff HEAD > ../diffs/whatever.diff and later git apply ../diffs/whatever.diff -3 (-3 for 3-way merge enabled).

I know a lot of people use git stash, but I'm not sure it's because they prefer it over git diff, but rather because they haven't considered it.

It could be just me, but I prefer to have my code snippets and changes to be as "tangible" as possible. Ability to back them up, add to git, reuse and all that is much more reliable and convenient with diff > apply.

What are your thoughts?

💖 💪 🙅 🚩
nirlanka
Nir Lanka ニル

Posted on June 3, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related