Introduction to the workshop
|
Sticky notes are signals to the instructor(s) and helper(s) during the class.
Blue-green is Yes / Good / Agree / I’m Caught Up.
Orange is No / Alert / Disagree / I Need Help.
|
Setting Up Git
|
Use git config to configure a user name, email address, editor, and other preferences once per machine.
|
Creating a Repository
|
|
Tracking Changes
|
git status shows the status of a repository.
Files can be stored in a project’s working directory (which users see), the staging area (where the next commit is being built up) and the local repository (where commits are permanently recorded).
git add puts files in the staging area.
git commit saves the staged content as a new commit in the local repository.
Always write a log message when committing changes.
|
Labeling Things and Undoing Things
|
Tags are human-friendlier ways of identifying a specific commit than hexadecimal codes. A tag stays with its commit and identifies one point in time.
Branches are names that will move forward as you add more commits. Branches identify lines of thought or particular variations.
git checkout brings specified versions into your working directory for investigation.
git checkout -b creates a named branch during checkout so that you won’t develop new code from a detached HEAD.
git reset removes commits from your history - use with caution!
git revert makes a new commit that counteracts the commits you want to undo.
Always write a log message when committing changes.
|
Pushing and Pulling to and from GitHub
|
A local Git repository can be connected to one or more remote repositories.
git push copies changes from a local repository to a remote repository.
git pull copies changes from a remote repository to a local repository.
|
Ignoring Things
|
|
Forks and Pull Requests
|
Any public repository on GitHub can be forked and modified.
If you make changes to a forked repository, you can request that the maintainer of the original repository merges your changes into theirs.
|
Conflicts
|
Conflicts occur when two or more people change the same file(s) at the same time.
The version control system does not allow people to overwrite each other’s changes blindly, but highlights conflicts so that they can be resolved.
|
Sharing one repository
|
|