A while back I wrote about managing local git branches with git rebase and I mentioned that I always submit my code changes with one commit only. No matter how many commits I make during my development process in my local branch when I prepare my code for code review and push it to remote, … Continue reading Git Squash Tutorial: How to Combine Git Commits for a Clear and Organized Commit History
Category: command line
git stash 101
git stash allows you to save your work in progress out of your way
Developing inside a Docker container
A few months ago I got a new computer and I have been very intentional about deciding what I install on it. From past experience I know that computers that are used as a development environment tend to get messy in no time since one might install all kinds of libraries, frameworks, dependencies, you name … Continue reading Developing inside a Docker container
Git, GitHub and GitLab. Are they all the same thing?
A few years back when I got serious about learning to program to become a software developer, I remember hearing about version control and getting really confused about git and GitHub (one can add GitLab to this list also!). Are they the same thing? Eventually I figured it out but this past week in a … Continue reading Git, GitHub and GitLab. Are they all the same thing?
Find the commit that introduced a bug in your code: how to use git bisect in 7 steps
When I first heard about git bisect I thought it sounded scary and complicated, so I never looked for an opportunity to learn more about it and use it. That's until last week when I ran into a bug in our master branch. I knew that the bug was not there two days before so … Continue reading Find the commit that introduced a bug in your code: how to use git bisect in 7 steps
TIL: docker commit
When I need to create a new custom Docker image, I usually start with a base image (alpine, debian, python, etc, depending on the project), running it in the interactive mode and install the tools and dependencies I will need. Once I get my container the way I want, I create a Dockerfile with all … Continue reading TIL: docker commit
Sending docker container logs to a separate file
In a large web application, the backend logs can get quite verbose: requests created, sent, processed, received, etc. The list can grow large very quickly depending on how logs are implemented. You can check the logs from a Docker container using docker logs, no need to exec into the container: docker logs <container_id> You can … Continue reading Sending docker container logs to a separate file
Command line shortcuts
I normally don't use many shortcuts because it's easier to just use my arrows and mouse to navigate than to memorize shortcuts but I am slowly realizing that the time spent on learning a new shortcut pays off. However, my memory is not that great and if I try to memorize multiple things at once, … Continue reading Command line shortcuts
Customize your terminal prompt with colors
NOTE: the steps below assumes you have a Bash shell. If you are using a Unix machine (Mac or Linux) and are not sure what type oh shell you have, it's probably Bash. In most systems, by default, the prompt in the terminal (or command window) displays the hostname and the working directory but this … Continue reading Customize your terminal prompt with colors
Check which commands you typed in the command line and don’t repeat yourself!
Recently I needed to repeat a series of long~ish commands in the command line but I never quite memorized them so I ended up resourcing to arrow-up-arrow-up-arrow-up </ad nauseum> until I found the command I was looking for. But there is a better and super simple way: history Typing history in the command line will … Continue reading Check which commands you typed in the command line and don’t repeat yourself!