In Simply Git, you learned how to unstage all of the changes, moving them from the staging to working area. The command and options are not intuitive, which means they are not rememberable. Let’s build an alias.
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.
Lab Introduction
Let me introduce you to this lab.
Let’s Review
WooHoo! You did! You now have a solid baseline of git commands that run a series of tasks for you. The intent is to make your job easier and git you productive.
Do Our Work
In this episode, you and I will change the GPL license from 2.0 to 3.0 in the new branch we created. You can get the license here.
Switch to a Different Branch (Checkout)
In the last episode, you created a new branch. But doing a git branch change/license did not move you into that new branch. How do you switch into a different branch? In git, we use a “checkout” process. That lets you switch and move around into different branches. Let’s do it together.
Branch Workflow
Let’s talk about the branch workflow. A branch is an isolated container where you can work on a specific task, i.e. your contribution. In this episode, you’ll learn about a branch and get an overflow of the workflow.
Update Branch with Rebase
In this episode, let’s use the rebase strategy for updating the branch. We’ll repeat the same process as we did in the merge strategy.
Putting it all Together
Let’s put it all together by making 2 more commits. Then we’ll push both of them to GitHub.
Unstage Changes
There are times when you are working that you stage a file and then decide not to include it in the commit. How can you unstage that file? Or what if you want to unstage all of the files? Here, let me show you in this episode.
Push it to GitHub
Let’s get your new repository hosted on GitHub. In this lab, you and I will create a new GitHub repository, create a .gitignore file, configure our repo to know that it should be wired to GitHub, and then push our code to GitHub. Let’s do it together.