Welcome to TWIL, our weekly series crafted to spark your programming savvy with bite-size learning. This episode, Emily unveils a nimble Git trick to access your last attempted commit message, saving you from retyping it during those hectic coding sessions. On another front, Frank demystifies ngrok Replays, offering insights on how to smartly leverage the tool's web interface for testing webhooks in your local dev environment. Stay tuned as we dive into these software development essentials, aimed at enhancing your technical toolkit!
Git Quick Tip: Access your last attempted commit message
If you ever attempt to commit and it fails for some reason (failed GPG signing, failed pre-commit validation, etc.) and think you’ve lost your beautifully written commit message, think again!
You can access the last attempted commit message with: cat .git/COMMIT_EDITMSG
.
- Git
ngrok Replays
I often use ngrok
to create tunnels to local application environments. It’s an easy and secure way to connect remote services like Webhooks to my work-in-progress and it’s a wonderful tool, but sometimes I can’t easily recreate an event that triggered what I’m testing.
Luckily, ngrok’s web interface features a Replay option!
Wait, you didn’t know ngrok had a web interface either? Well my friends…
In the web interface, you’ll find an option to “Inspect”, and there you’ll see all the requests that have been received by your current ngrok tunnel’s session.
Notice the button to the right of the request’s tabs? Select any request from the All Requests list and now you can Replay by clicking that button!
But wait, there’s more! Another option is “Replay with Modifications” — where you can replay the request, but alter nearly everything about it from the HTTP method, the Path, the Headers, and the Body!
- Tools
- ngrok