The command git status gives you a report (view) of the current state of both your working directory and staging area. But it also gives you more information, such as different commands you can use. Let’s dive into the status.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Git Commit – Store & Document a Snapshot
Next, let’s dive into the git commit command. We’ll also talk about writing a more verbose commit message using the text editor. If you need to configure git to pop open your text editor of choice, click here for Mac or here for Windows.
Git Add – Stage Small Changes
Let’s rename our theme while we work through the process of adding small changes into the staging area. You can refer to the Git documentation here.
Create a New Branch
In this lab, you and I will change the GPL license version from 2.0 to 3.0. To get started, you need to create a new branch. Let’s do that together in this episode.
Clean up & Pull Down Updates
Next, you need to clean up the local and remote branch. Why? It’s not needed anymore as it’s been merged into the project. You and I will do that together. Then we’ll walk through how to go get the latest version of the develop branch so that your copy on your local machine is up-to-date.
Add Upstream Remote
You now have a local version of the repository on your machine. Plus, you have a forked version in your GitHub account. Let’s wire both of these to the original repository. To check what remotes are configured, type: git remote -v To add a new upstream remote, type: git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git Here is the article on GitHub.
Clone It to Your Local Machine
To get a copy of the repository on your local machine, you do a git clone. Let’s do it together and look at what happens. You’ll also look at the current remote configuration by using git remote -v.
Fork a Remote Copy
For you to contribute, the process starts when you make a copy of the shared, centralized repository. To do that, you fork a copy into your personal GitHub account. Here is a link to the repository you and I will be working on together in this lab.
The Wiring – Fork. Clone. Upstream.
How do you wire up your copy of the team’s project to the project’s repository on the remote server, i.e. GitHub? Let’s talk about the wiring as I introduce you to the concept of forking, cloning, remotes, origin and upstream.
3 Locals – Working, Staging, & Storage
Let’s explore the 3 distinct, local areas that git is managing for you. I’ll show you in my code. And then we’ll talk about the different commands for taking snapshots and storing them into the staging, storage, and even on GitHub.