Welcome to the second part of How to start using the command line. You can read part 1 here if you haven’t already – I cover the most basic commands there to get you started.
In this second part, I’ll go through a few more basic commands and introduce the concept of a flag that you can use to modify certain commands. A flag can, for example, be used to modify the command rm to act on a directory instead of a file.
Suppose you’re part of the engineering team of a tech company whose product is involves giving users product recommendation widgets for online stores. Since the product is already in the wild, so to speak, how do you test developmental features on live stores?
At work recently, our CTO noticed that our main repository’s staging branch had over 80 less commits than master. That shouldn’t be the case, because our deployment pipeline has always been to go from feature -> staging -> master. Code that exist on master must therefore already exist in staging, right?
No, turns out nothing was really wrong. It’s just that whenever we close a pull request (PR) on GitHub, our team protocol is to hit the “Merge” button, which merges all the commits from the PR into master, but not without adding one extra commit at the top called the “merge commit”. Each PR created one extra commit on master. That was the reason for the commit count mismatch.