Day 24 - Advanced Git

Fall 2022

Dr. Jared Joseph

November 06, 2022

Overview

Timeline

  • git Recap
  • git in the Terminal
  • Advanced git
  • Advanced Github

Goal

Learn how to use git to effectively collaborate

git Recap

git as Timelines

The Turing Way

git Workflow

git in the Terminal

Key Terms

repo
Repository - the collection of git files that contain your project
commit
To save a checkpoint of your project for future reference
revert
Undo all changes made to a file since the last commit
staged
A file that is preparing to be commited, but has not yet been
push
To ‘push’ files from your local machine onto an internet service
pull
To ‘pull’ files from a remote service onto your machine
merge
To combine two branches/files of the same project
conflict
When two files or set of files have changes that cannot be easily merged
checkout
Load in a previous checkpoint (commit) or switch to a branch

git Commands

git status
Check the staging area and what branch you are on.
git add <FILES>
Add a file to the staging area
git commit -m “COMMIT MESSAGE”
To save a checkpoint of your project for future reference
git revert <FILES>
Undo all changes made to a file since the last commit
git push
To ‘push’ files from your local machine onto an internet service
git pull
To ‘pull’ files from a remote service onto your machine
git merge <BRANCH NAME>
To combine two branches branches. It will merge the branch you name into your current branch.
git checkout <BRANCH NAME>
Load in a previous checkpoint (commit) or switch to a branch. Use the “-B” flag to create this branch at the same time.

Advanced git

git Ignore

The hidden .gitignore file lets you tell git “I do not want you to pay attention to these files or folders.”


This can be very handy if you want to:

  • Ignore all .csv files
  • Ignore your scrap folder
  • Ignore the file containing your API keys
  • etc

Branches

The Turing Way

branch ->

<- merge

git checkout <NAME OF BRANCH>
Switch between branches
git checkout -B <NAME OF BRANCH>
Create new branch and switch to it
git merge <NAME OF BRANCH>
Merge two branches

Advanced Github

Issues

Pull Requests and Review

Forking

Code-Along

For Next Time

Topic

Lab 6 Review

To-Do

  • Finish Worksheet
  • Class Survey