Datapipe Weekly #19

Hello friend! This is a newsletter for builders.

What do you like to build?

I hope the ideas in this week’s newsletter can help you get it done.

In this weeks newsletter

  • 💻 Trick: Git stash - for the Forgetful

  • 📜 Quote of the week


Trick: Git stash - for the Forgetful

The other day I started developing my little project on master branch:

➜  my-little-project git:(master) ✗ git ls-files
README.md
app.py
index.html

I changed a few files and had a state like this:

➜  my-little-project git:(master) ✗ git status 
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   app.py
	modified:   index.html

And that’s when I realized I didn’t want to commit this stuff on master. Instead I wanted to be working on a new brach and commit my changes there.

Luckily the fix was hella easy.

  1. Use git stash to store and revert my changes

  2. Create and checkout new branch

  3. Apply stashed changes to branch and commit

1.

➜  my-little-project git:(master) ✗ git stash
Saved working directory and index state WIP on master: 73fcb9d Initial commit
➜  my-little-project git:(master) git status 
On branch master
nothing to commit, working tree clean

2.

➜  my-little-project git:(master) git branch new-branch-thingy
➜  my-little-project git:(master) git checkout new-branch-thingy 
Switched to branch 'new-branch-thingy'

3.

➜  my-little-project git:(new-branch-thingy) git stash apply
On branch new-branch-thingy
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   app.py
	modified:   index.html

no changes added to commit (use "git add" and/or "git commit -a")
➜  my-little-project git:(new-branch-thingy) ✗ git add -u
➜  my-little-project git:(new-branch-thingy) ✗ git commit -m "Hell yeeeeahh"
[new-branch-thingy 2321aa5] Hell yeeeeahh
 2 files changed, 2 insertions(+)

And just like that - it was as if I never forgot that developing on master branch was a bad idea ;)

More solutions to this problem here, if you’re interested.


Quote of the week

“The vigor of the soul is sophrosyne, the light of a soul free of disturbing passions.”
- Demophilus

The concept of sophrosyne is related to self control, minimalism and balance in life. Put in a modern way - limiting your “inputs”.

Generally speaking I’ve got too many inputs - like books to read, movies to watch, things to create.

I can be compulsive with my desires to acquire . In fact - just today when I discovered about the concept of sophrosyne my first reaction was to look up the best books on the subject. The irony of this is just awesome. Besides - I’ve already got a list long enough to take me through the next 10 years.

-Alex


Thank you for reading Datapipe 👋


Subscribe the Datapipe weekly newsletter ⬇️