This section should help you take the first steps towards expanding your Git toolkit and understanding what's actually going on under the hood with Git.
Hopefully you've been using the basic Git commands to create repositories and push your code up to GitHub. If not, you've got a bit of catching up to do but don't worry.
In any case, Git is a crucial skill to have whether you're a professional web developer or just a hobbyist who needs to back up your code base. It's the "save" button on steroids and it allows giant teams of developers to collaborate. There really aren't all that many commands for you to learn either, but sometimes the real difficulty of it comes from visualizing in your head what it's actually doing.
In this lesson, we'll dive deeper than just the
$ git add .and
$ git commitand
$ git pushcommands you've mostly been using. Maybe you've had the dubious pleasure of getting a merge conflict when you tried to pull or push changes. Maybe you're just curious how multiple developers can work on a single code base at the same time. Either way, this section should help you take the first steps towards expanding your Git toolkit and understanding what's actually going on under the hood with Git.
It's important to take a look at this stuff before getting any deeper into things because the project work is becoming more and more complex so using a disciplined Git workflow is no longer optional. The axiom used to be "save early and often" and now it's "commit early and often". Hopefully, after you've finished this lesson you will feel much more comfortable with the basics and at least know what to Google if you'd like to do more.
We'll begin by reading some things that are probably review from Foundations but, if you're like most people, you could benefit from a refresher. We'll then dive deeper into topics that are relevant so you can use git for a more effective workflow, whether you're just working on your own project or trying to bring in collaborators as well.
Look through these now and then use them to test yourself after doing the assignment:
- How do you amend a commit message that you just messed up?
- How do you view the history of your most recent commits?
- What are two different uses for
$ git checkout?
- How do you undo a recent commit?
- What are branches?
- How do you create a new branch to work on?
- How do you push that (non-master) branch up to GitHub?
- How do you merge the changes from your new branch into the master branch again?
- Why is working with feature branches useful?
- What is the difference between using
$ git mergeand
$ git rebase? (hint: history)
- What is the difference between a "remote" and your local repo?
- How do you add your GitHub repo as the remote?
This section contains helpful links to other content. It isn't required, so consider it supplemental for if you need to dive deeper into something.