- Review Git basics
- Preview Git workflow
Developers use version control systems (VCS) to organize our code and the most commonly used VCS is Git. Git provides a number of tools and techniques we can use to improve our effectiveness as developers: creating backups, creating "save points" where which we can "undo" to, sharing work between team-mates. Remember, Git, and VCS in general, are all about giving us the ability to be unafraid to make changes. By putting risk in check, we gain freedom. That's a great place to be in when we're writing code!
At this point, there are several Git actions we should feel comfortable doing, including:
- Identify how to initialize a Git repository with
git init
- Check the status of a repository with
git status
- Prepare file changes to be committed with
git add
- Create a commit and apply a commit message with
git commit
- Copy a repository to your local machine with
git clone
- List remotes with
git remote
- Duplicate other organizations' repositories into your own via GitHub with
git fork
- Create a remote repository on GitHub
- Connect a local repository to a remote repository with
git remote
- Send code to the remote repo with
git push
If any of these seem less familiar than others, this is a good time to go back to those lessons or resources and strengthen our understanding of them. We'll need these basics as we move on to more Git.
Git gives us a lot of special powers and over the next several lessons we'll explore some more of them. We'll learn one of the most useful Git features, branching. Specifically, we'll see how to:
- Create a branch
- Delete a branch
- Push a branch
- Pull a branch
- Discuss local and remote branches
- Merge a branch
- Practice merging branches
In addition, to accomplish the work we just described with branches, we'll sometimes need Git to help us get more information or correct mistakes.
- Review a repository’s history ("Tell me the story of how this codebase changed since 4 days ago...")
- Review a Git commit's "diff" ("What changed in that commit?")
- Unstage changes ("Don't add that to a commit!")
- Revert changes ("Undo that commit!")
By the time we've worked through these lessons, you'll have a list of new Git tools to use in your regular coding workflow.
Building on the Git basics we've already acquired, we're now prepared to learn more advanced Git actions like working with branches, examining Git history and manipulating changes.