
Course introduction, welcome and course goals.
In order to meet the course goals outlined in the previous lecture, this course will follow an outline featured in the lecture.
A brief introduction and information about the author/instructor for this course.
This course has a specific audience in mind -- mainly freelancers, developers, programmers, and other creative professionals.
The majority of the course will be done using the command line (Git Bash / Terminal). This lecture explains why.
Not everyone is convinced of the need for version control -- so I go over the main reasons one should use it.
Once convinced of the need for version control, this lecture goes into Git's unique qualities and why Git is an excellent version control system.
At this point, we assume you plan to use Git for version control and continue with the course, so this lecture goes over some key terminology that will be helpful to understand before moving forward.
Git Installation section overview and what approach will be taken.
A step-by-step installation of Git on Windows, including recommended options and choices.
A step-by-step installation of Git on the Mac platform (featuring Yosemite).
Part one of the "Quick Start" section -- starting with GitHub and initial project setup.
Part two of the "Quick Start" section -- configuration, cloning from GitHub and the entire Git workflow (add, commit, push and pull).
Command listings for this section.
GitHub has recently made the new default branch name to be called "main" instead of "master" - which might cause some issues within the course. This lecture covers why and how to work around this issue.
Install and configure text editors for Git workflows across Windows and macOS, enabling Notepad++ and TextMate 2 to work with command prompt, Git Bash, and Git.
Install Notepad++ on Windows by downloading from notepad-plus-plus.org, accepting license, selecting components and install location, creating desktop shortcut, and configuring the path environment variable to run it from Git Bash.
Configure notepad++ with git on Windows by creating a bash alias in .bash_profile and setting notepad++ as the global git editor, then verify the setup with git config --global --list.
Download and install TextMate 2 from Macromates, move it to applications, and launch it. Enable shell support in preferences to use the mate command in the terminal and test it.
Link git with textmate 2 on mac by setting core.editor to mate -w and verify via git config --global -e. Update .tm_properties in home to fontName Menlow and fontSIze 24.
Explore core Git commands and three project setup methods, then follow a workflow from editing and staging to committing and pushing or pulling, while managing files and using Git aliases.
Initialize a fresh Git repository with git init, add a new file to the staging area, and commit to the master branch with a descriptive message.
Demonstrates adding git to an existing project, initializing a repo, staging files with git add ., committing with an inline message, and inspecting the master branch and .git folder.
Log in to GitHub, fork the starter-web repository, clone it to your local machine, and verify origin and master status with git status to begin working.
Master basic git workflow by adding a file, staging with git add, committing with a message, pulling to stay up to date, and pushing to origin master on GitHub.
Edit your gitconfig and work with a demo repo to see how Git tracks files, using git status and git ls-files, then stage in the index and commit with -a.
Edit hipster.txt in a git repository, then use git status to see staged and unstaged changes, stage with git add, and commit with git commit.
Learn to recursively add files to a git repository by creating a deep folder structure with mkdir -p, then use git add to stage all files and commit the changes.
Learn how to back out changes in a git repository by unstaging with git reset HEAD the file, and discarding modifications via git checkout to restore the last committed state.
Learn to rename and move files in git with git mv or OS moves, track changes with git status and git add -a or -u, and commit renames.
Learn how to delete files in Git, including untracked files with rm, tracked files with git rm, and how to unstage or restore deletions using reset, checkout, and commit workflows.
Investigate git history using the log command and its options. Learn to view commits, abbreviate identifiers, graph branches, filter by date, and inspect file history with git show.
Create and use Git aliases to simplify complex commands by configuring a global alias, such as hist for git log --all --graph --decorate --oneline, stored in your .gitconfig.
Exclude unwanted files in a git repository with a .gitignore, adding patterns for .DS_Store and log directories, then commit and update status.
Synchronize local work with GitHub by pulling from origin master, pushing to origin master, and verify the updated commit history (16 commits) on the forked repository.
Install and configure a visual diff and merge tool for Git using P4Merge. The lecture covers Windows and Mac setup and integration with Git for conflict resolution.
Install the P4Merge Visual Merge Tool on Windows by downloading from perforce.com, selecting 64-bit, and installing only the Visual Merge Tool via the installer.
Configure P4Merge on Windows to be accessible from any command prompt by updating the system path with the Perforce folder and verifying in Git Bash, PowerShell, or cmd.
Configure git globally to use P4Merge as the diff and merge tool on Windows, by setting mergetool.p4merge.path, difftool.p4merge.path, and turning off prompts.
install and verify p4merge on macos for use with git, guiding you through downloading from perforce.com, selecting the right macos version, installing the p4merge app, and launching it.
Configure P4Merge as git's diff and merge tool on macOS, set paths, disable prompts, and review global gitconfig for seamless version control.
Set up a git repository, create and edit a README.md with markdown headings, commit changes, and push updates to GitHub to demonstrate basic comparison workflows.
Compare the working directory and staging area with git status and git diff, then view changes using a visual difftool like P4Merge to see working directory edits versus staged edits.
Compare the working directory to last commit with git diff HEAD and difftool to see added sentences side by side; right is the working directory, left is the last commit.
Compare the staged changes with the last commit on the current branch using git diff --staged HEAD, and visualize differences with difftool to see what is staged versus HEAD.
Limit a diff to one file by running git diff -- README.md, verify with git difftool, and keep other file changes unstaged.
Compare arbitrary commits using git diff with commit ids and HEAD, view changes via difftool, and examine added or deleted files between points in history.
Compare local and remote master branches using git diff and git difftool to visualize differences between committed master and origin/master on GitHub.
Staging changes, committing with a descriptive message, and pushing to origin master after ensuring a clean, up-to-date status, with README updates visible on GitHub.
Master git branches to isolate changes from master. Create and switch branches with git branch and git checkout, and rename or delete branches.
Create a feature branch, edit simple.html, and commit the changes. Then merge into master with a fast-forward, after reviewing diffs, and delete the branch.
Create and switch to a new local branch, implement a copyright notice, and commit changes; then merge back to master with --no-ff to preserve the merge history.
Show how an automatic merge creates a merge commit on master after creating a feature branch, editing files like humans.txt and README, and merging back.
Resolve merge conflicts in git by creating branches, performing merges, and using a three-way mergetool to choose winning changes, then commit and ignore .orig files.
Clean up local branches, then pull origin master to stay up to date. Push master to origin and verify on GitHub; the commit updates .gitignore to exclude temporary merge files.
Learn how to perform a basic rebase by creating a feature branch from master, making commits, rebasing onto master, and completing with a fast-forward merge and branch cleanup.
Switch to the master branch and modify simple.html to prepare for rebasing conflicts. Then create and switch to a new branch bigtrouble, commit changes, switch back, and review diverged history.
Switch to the bigtrouble branch, compare with master using git difftool to inspect conflicts in simple.html. Abort the rebase with git rebase --abort to return to a clean state.
Learn how to handle rebase conflicts with a visual merge tool, resolve and continue rebases, and perform a fast-forward merge back into master.
Fetch updates to non-destructively sync with origin, then rebase your local master on top of origin/master using git pull --rebase origin master to incorporate remote changes while preserving your commits.
Practice cleaning up after a rebase by deleting the bigtrouble branch, syncing with origin master, and pushing changes to GitHub, including updating the simple.html copyright notice.
Git Complete
This course is designed to be a comprehensive approach to Git, which means no prior knowledge or experience is required but students will emerge at the end with a very solid understanding and hands-on experience with Git and related source control concepts.
Recent Course Updates
Course Outline
Course Introduction and Overview provides an introduction to this course and the Git source control system and sets the stage for the rest of the course.
After the introduction, the first thing we do is Git Installation for both Windows and Mac.
Quick Start a very quick (15 minutes), hands-on introduction to Git. We start off by signing up for GitHub, creating a repository there, the makiing a local copy (clone), local changes (add/commit) and then update GitHub with our changes (push).
In Basic Commands, we walk through all the foundational commands needed to start a new project managed by Git (or enable Git for an existing project) all the way through making commits, including common file operations like moving and deleting files. We also cover how to exclude the wrong files from accidentally being committed and how to review your repository's history.
With a strong foundation in place, we explore ways to make Comparisons in Git, including all the different local states, between commits, and between local and remote repositories.
We give great attending to Branching and Merging in Git. We start off with the simple "happy path" and learn about "Fast-Forward" merges and how to control them. The we walk through common "automatic" merges. Finally, we cause trouble on purpose so we can step through resolving conflicting merges with our visual merge tool.
With a strong foundation in branching and merging, we will then cover a more complex topic, Rebasing. In that section, we cover several rebasing examples, including how to resolve a rebase conflict.
In the Stashing section, we save our work-in-progress while we attend to more pressing issues, then pick up where we left off after that.
NEW: In the Tagging section, we mark important milestones or releases within our project. We also use those tags later for comparing differences between important milestones. We also look at how to use tags within GitHub.
All tools have installation and configuration sections to ensure no one is left behind.
Course Features
Presentations provide audio/video training of conceptual ideas. Since few like slide-ware presentations, slide-presentations are kept to a minimum.
Screencasts provide a video of the instructor's computer system with any actions, commands, or screens displayed and narrated. There is nearly 4 hours of screencast based video training in order to step through each command or action in sufficient detail.
Several attachments and document lectures throughout the course provide supplemental information, illustrations, or other reference material.
Moving Forward
This course will expand periodically to include more topics, supporting materials and bonus content! Some content may be in direct response to student feedback or discussions -- so get engaged with the course discussions feature!