Skip to content

Latest commit

 

History

History
101 lines (75 loc) · 4.35 KB

github.md

File metadata and controls

101 lines (75 loc) · 4.35 KB

GitHub Basics

How to work with Git and GitHub...

What is Git?

  • Distributed version control system
  • Free and open source
  • Works for small and huge projects
  • Supports local repositories and servers
  • Want to learn all the details? Free, online book...
  • We will use GitHub

GitHub

Homework: Create a GitHub profile if you do not already have one

  • Use an alias if you don't want you real name online
    • Let me know your alias via email
  • Public repositories via GitHub Classroom for homeworks
    • You commit the code
    • I add comments and issues
  • Private repositories for exams

How to Use Git?

What You Have to Know

What You Have to Know - Git CLI

Command Description
git init Create an empty Git repository or reinitialize an existing one
git clone Clone a repository into a new directory
git pull Fetch from and integrate with another repository or a local branch
git add Add file contents to the index
git commit Record changes to the repository
git log Show commit logs
git push Update remote refs along with associated objects
git status Show the working tree status
git config Get and set repository or global options

What You Should Know

What You Should Know - Git CLI

Command Description
git branch List, create, or delete branches
git checkout Switch branches or restore working tree files
git merge Join two or more development histories together
git stash Stash the changes in a dirty working directory away
git remote Manage set of tracked repositories
git reset Reset current HEAD to the specified state

Exercise

  • Git Basics exercise
  • Follow the GitHub Flow to add your lightning talk subject to Online Course Calendar
    • Fork the project.
    • Create a topic branch from master.
    • Add your subject to course calendar.
    • Commit your changes to your topic branch.
    • Push this branch to your GitHub project.
    • Open a Pull Request on GitHub.
    • Discuss, and optionally continue committing.
    • The project owner merges the Pull Request.