About 2.5 hours
Imagine you are coloring on a flower coloring book. You colored in green for all leaves and now it’s time for the best part, the petal. You know you enjoy red the best but it looked horrible after you finished it. With Git, you can revert your choice of red in a heartbeat and you are free to reapply the red if you change your mind. A work doesn’t have to be permanent; every action is recorded and reversible. (Source: https://dev.to/maestromac/comment/him)
Participants will be able to:
Git and Version Control (video walkthrough of slides)
Git and Version Control (slides)
“Typing commands into the Terminal is scary so I’ll just skip this Git stuff.” There’s really no getting around needing to use Git. It’s OK if typing into the Terminal feels scary at the beginning. As you grow in your skills, using the Terminal will actually become faster than using your mouse and the Finder window!
“I don’t think I’ll ever use this, so I’ll just skip this Git stuff.” You may not be able to see a use for Git now, but once you start working on multi-file projects you’ll hopefully understand why it’s an integral part of almost every software engineering workflow.
Instructor will demonstrate:
Techtonica staff will assign pairs. Go through the following steps on one pair partner’s computer first, then go through all the steps again the other pair partner’s computer. The repetition of doing this twice will help solidify the new concepts.
git --version
. If a version number appears, you already have git installed. If a version number does not appear:
git
via Homebrew: brew install git
> If Homebrew isn’t install, check out Command Line Advanced lesson.git
and follow the prompts to install Git.Using the Terminal, navigate to the Desktop.
Create a new folder called git_example
. Navigate to this folder.
Run the git status
command. What happens? Run the git init
command to make git_example
start keeping track of changes that happen within the folder.
Run git status
. What do you see?
Create a new file in git_example
called my-favorite-animals.txt
.
Run git status
. What do you see?
Add some text to my-favorite-animals.txt
. Save the file.
Run git status
. What do you see?
Run git add my-favorite-animals.txt
.
Run git status
. What do you see?
Run git commit -m "Create new file.
.
Run git status
. What do you see?
Spend just 30 minutes working through Git Immersion: A guided tour that walks through the fundamentals of Git, then stop wherever you are. If the first page takes more than a minute to figure out, you can skip it for now.
With computers closed, participants as a group will guide the instructor through creating, adding and committing file changes using Git.
git log
to verify that it workedgit status
and git diff
githug
in your command-line prompt to play. When you think you’ve solved a level, type githug
again to check your work. You’ll get feedback and hints. Please complete at least up to #32: checkout
and return to the game throughout the program to practice things like merge
and rebase
.Form small groups and discuss:
git status
do?If you have time, continue the Git Immersion and githug tutorials if you aren’t finished. Also try looking through the supplemental materials. be)