It is time to get into coding examples from the command line!
In previous tips, you used either the Create new file or Edit file buttons on GitHub.com itself to make changes to a repo. Then you selected the Create a new branch for this commit option in either the Commit new file or Commit changes form to create a new branch (which will be used by a Pull Request).
In the upcoming days, you’ll see how to setup a branch in your local repo so you can submit a bug fix to the base repo as a Pull Request.
From your favorite Command line Interface (I’m using GitHub Desktop’s Git Shell that opens Git Bash – see yesterday’s tip), you’ll want to
- Clone the repo
- Create a branch (see tomorrow’s tip)
- Make your changes (see tomorrow’s tip)
- Push your branch back up to your GitHub repo (see the day after tomorrow’s tip)
But first, let’s clone the repo.
Go to the desired repo. For this example, I’m using saraford-tips/your-moment-of-github-zen
You can get the clone instructions from clicking the Clone or download dropdown button, and then coping the URL (either select the text inside the edit box or click the Copy to clipboard button).
Now from the command line, run git clone <copied url>
Now cd into your repo, and you are all set locally! I always do a git status just out of habit.