What if you made a typo or forgot to add something in the last commit message? Can you go back and fix it? Yes, you can by using git commit –amend. Here, let’s do it together.
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.
Pull Request Workflow
Let’s walk through and discuss the pull request workflow. This process is your workflow for submitting your contribution for consideration to be added (merged) to the project. The steps: It starts on your local machine where you are building and validating your work in a branch. Then you push your branch to your forked copy of the project, i.e. in your GitHub project (which is the remote origin). Open a Pull Request and fill out relevant and informative information to tell the review team what your contribution is. If the project has a Continuous Integration (CI) server, your contribution is […]
Git Status – View State of Working & Staging
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.
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.