Getting Started with Git & GitHub TD Workshop 3 Nhi Nguyen Diana Westerfer Adam Wolf
Mac Users: Please sit at the left side of the room (facing us) Windows Users: Please sit at the right side of the room (facing us) 2
Pre-Workshop Checklist ✘ We always ask this question, and we hope you’ll say YES …. Do you have your laptop with you? ✘ Did you download Git, GitHub Desktop, and VS Code? ✘ Did you create your account on GitHub website? ✘ If you haven’t → check out the instruction on AIS website ✘ If you encounter issues → ask our Student Leaders and Assistants! 3
✘ Speaker Series 7: - Mon, November 18 - Stacey Jafee, Scholastic ✘ Panel Discussion: Data Everywhere - Thu, November 21 - 7th Floor, Alter Hall 4 AIS Upcoming Events
Our Student Leaders Adam Wolf MIS Major BI Consultant @ RSM 5 Diana Westerfer MIS Major, IB Minor Cost Control Analyst @ Riggs Distler
What are we doing today? 6
Our phases are: 7 1 Git Terminology & Concept Git Commands Your first Git commit 2 GitHub Why? Create your first remote repo GitHub GitHub Desktop Clone a remote repo and collaboration 3 Review 4
Phase 1: Git Concept & Terminology 8
What is Git and Version Control?
Version Control? ✘ Version Control System = VCS ✘ A systems that keeps records of your changes ✘ Allows for collaborative development ✘ Allows you to know who made what changes and when ✘ Allows you to revert any changes and go back to a previous states 10
Git is…. ✘ Open-source ✘ Developed in 2005 by Linus Torvalds ✘ The most widely used version control system ✘ Distributed VCS ✘ Efficient performance, security, and flexibility 11
What is the Command Line Interpreter? 12 ✘ CLI is an application that allows users to input text commands to perform actions - Windows: Command Prompt - Mac: Terminal ✘ CLI is more efficient than any graphical user interface once you learn the syntax, especially when programming
Let’s open your CLI and run some commands! 13
14 Exercise 1: Create a folder with Command Line Scenario: You want to create for this workshop
15 Mac Users Windows Users See the path pwd echo %cd% List files in directory ls dir Change directory cd cd Create an empty folder mkdir mkdir Create an empty file touch type nul >
16 Exercise 2: Set up a Git Repository for your Folder Scenario: You want to create a Git tracker
Repository A software repository, colloquially known as a "repo", is a storage location from which software packages may be retrieved and installed on a computer.
Setting up Git Check Git Version git --version Set Config Values git config --global user.name “YourName” git config --global user.email “you@email.com” 18 --system > --global > --local
Create Git Repo Initialize Git repository git init Before first commit git status 19
20 Look at your hidden .git file!
WHERE ARE WE NOW? 21 Staging Area History (.git directory) Working Directory Stage Fixes Commit Checkout the project .We are here
WHERE ARE WE NOW? 22 Staging Area History (.git directory) Working Directory git add git commit
23 Exercise 3: Add files to the Staging Area of Git repo Scenario: You want to track the changes you made in the folder (part 1)
Add files to Staging Area Add Files to Staging Area git add -A or git add . (add all files) git add filename (add one single file) Remove files from Staging Area git reset (remove everything) git reset filename (remove one single file) 24
Add a .gitignore Add gitignore file touch .gitignore or type nul > .gitignore Before first commit git status 25 Add gitignore file touch .gitignore or type nul > .gitignore
26 Exercise 4: Commit the changes to go to the final stage (History) Scenario: You want to track the changes you made in the folder (part 2)
Our first Git commit!! Our First Commit git commit -m “message goes here” Rules for messages: ✘ No period “.” ✘ < 50 characters ✘ Active voice and verbs 27
Do It Yourself Time! 28
The challenge: 29 ✘ Create a new file called misclass.html ✘ Add a new h1 and paragraph to your misclass.html file for “Favorite MIS Classes” ✘ Make the commit to your Git repo to track these changes!
Phase 2: GitHub Adventure! 30
Let’s first talk about GitHub a little bit... 31
What is GitHub? A collaboration platform built on top of Git. It nurtures a community for developers and supports open source. GitHub = the Google Drive for the coding community!
Overview of GitHub dashboard Let’s go your GitHub account!
The Process 34 4 COMMIT CHANGES AND PUSH BACK TO REMOTE REPO 3 MAKE CHANGES LOCALLY 2 CLONE THE REPO TO YOUR LOCAL LAPTOP 1 CREATE A REMOTE REPO IN GITHUB
35 Exercise 5: Create A Remote Repo from GitHub Scenario: You want to track an existing, remote project using Git (p1)
36 Exercise 6: Clone this remote repo to your local git repo in your laptop Scenario: You want to track an existing, remote project using Git (p2)
37 Exercise 7: Make changes locally and push it to your remote GitHub repo Scenario: You want to track an existing, remote project using Git (p3)
Work with a Remote Repo Cloning a remote repo git clone <url> <where to clone> 38 Push new changesCommit Changes Locally ● git status ● git add -A ● git commit -m “message” Update the remote repo
Update the changes to remote repo Pull to update the remote repo git pull 39 Push new changes to the remote repo git push Push new changes ● git push Commit Changes Locally Update the remote repo ● git pull
Common Workflow 40
Common Workflow 41
Phase 3: Using GitHub Desktop! 42
Github Desktop Installed application that let’s us interact with Github without relying on a browser ● Same functions ● Easier than CLI ● Still free!
GitHub Desktop is a GUI! 44 ● GUI (Graphical User Interface) is is a system of interactive components such as icons and other graphical objects that help a user interact with computer software, such as an operating system. ● Is considered to be more user-friendly than a text-based command-line interface (CLI)
Benefits over Browser ✘ Same Benefits ✘ GUI ✘ You need a git client to make changes ✘ No Command Line 45
46 Exercise 8: Use GitHub Desktop to clone a remote repo Scenario: You want to use an open-source project
What we’re gonna do: 47 ✘ Clone a remote Repo ✘ Manipulate Pre-Written Code - Tell us about yourself! ✘ Make it your own Repo
Getting Started: 48 ✘ Navigate to Nhi’s repo: https://github.com/nhi-ng/blogtemplate.git ✘ Clone the remote repo ✘ Edit Code in Visual Studio Code ✘ Push it back to your own GitHub account
49 Exercise 9: Make changes and create new repo using GitHub Desktop Scenario: You want to upload your code to GitHub
Phase 4: Review Time!!! 50
Let’s go to www.kahoot.it 51
52 Track changes in folders and files Git commands Understand Git Try GitHub Desktop Create your first remote repo
Resources! 53
54 ● GitHub Tutorial for Beginners: Command-Line Fundamentals ○ https://www.youtube.com/watch?v=HVsySz-h9r4 ● LinkedIn Learning: Version Control and Collaboration with GitHub ○ https://www.linkedin.com/learning/learning-github/version-cont rol-and-collaboration-with-github?u=2206009 ● GitHub Learning Lab ○ https://lab.github.com/
55 https://ibit.temple.edu/programs/digital-innovation-foundry/
56 Thanks for coming! Suitable Code AIS Attendance http://bit.ly/TD-SAT3 Exit Code: gitiful

AIS Technical Development Workshop 3: Getting Started with Git and GitHub

  • 1.
    Getting Started with Git& GitHub TD Workshop 3 Nhi Nguyen Diana Westerfer Adam Wolf
  • 2.
    Mac Users: Pleasesit at the left side of the room (facing us) Windows Users: Please sit at the right side of the room (facing us) 2
  • 3.
    Pre-Workshop Checklist ✘ Wealways ask this question, and we hope you’ll say YES …. Do you have your laptop with you? ✘ Did you download Git, GitHub Desktop, and VS Code? ✘ Did you create your account on GitHub website? ✘ If you haven’t → check out the instruction on AIS website ✘ If you encounter issues → ask our Student Leaders and Assistants! 3
  • 4.
    ✘ Speaker Series7: - Mon, November 18 - Stacey Jafee, Scholastic ✘ Panel Discussion: Data Everywhere - Thu, November 21 - 7th Floor, Alter Hall 4 AIS Upcoming Events
  • 5.
    Our Student Leaders AdamWolf MIS Major BI Consultant @ RSM 5 Diana Westerfer MIS Major, IB Minor Cost Control Analyst @ Riggs Distler
  • 6.
    What are wedoing today? 6
  • 7.
    Our phases are: 7 1 Git Terminology& Concept Git Commands Your first Git commit 2 GitHub Why? Create your first remote repo GitHub GitHub Desktop Clone a remote repo and collaboration 3 Review 4
  • 8.
    Phase 1: Git Concept& Terminology 8
  • 9.
    What is Gitand Version Control?
  • 10.
    Version Control? ✘ VersionControl System = VCS ✘ A systems that keeps records of your changes ✘ Allows for collaborative development ✘ Allows you to know who made what changes and when ✘ Allows you to revert any changes and go back to a previous states 10
  • 11.
    Git is…. ✘ Open-source ✘Developed in 2005 by Linus Torvalds ✘ The most widely used version control system ✘ Distributed VCS ✘ Efficient performance, security, and flexibility 11
  • 12.
    What is theCommand Line Interpreter? 12 ✘ CLI is an application that allows users to input text commands to perform actions - Windows: Command Prompt - Mac: Terminal ✘ CLI is more efficient than any graphical user interface once you learn the syntax, especially when programming
  • 13.
    Let’s open yourCLI and run some commands! 13
  • 14.
    14 Exercise 1: Createa folder with Command Line Scenario: You want to create for this workshop
  • 15.
    15 Mac Users WindowsUsers See the path pwd echo %cd% List files in directory ls dir Change directory cd cd Create an empty folder mkdir mkdir Create an empty file touch type nul >
  • 16.
    16 Exercise 2: Setup a Git Repository for your Folder Scenario: You want to create a Git tracker
  • 17.
    Repository A software repository,colloquially known as a "repo", is a storage location from which software packages may be retrieved and installed on a computer.
  • 18.
    Setting up Git CheckGit Version git --version Set Config Values git config --global user.name “YourName” git config --global user.email “you@email.com” 18 --system > --global > --local
  • 19.
    Create Git Repo InitializeGit repository git init Before first commit git status 19
  • 20.
    20 Look at yourhidden .git file!
  • 21.
    WHERE ARE WENOW? 21 Staging Area History (.git directory) Working Directory Stage Fixes Commit Checkout the project .We are here
  • 22.
    WHERE ARE WENOW? 22 Staging Area History (.git directory) Working Directory git add git commit
  • 23.
    23 Exercise 3: Addfiles to the Staging Area of Git repo Scenario: You want to track the changes you made in the folder (part 1)
  • 24.
    Add files toStaging Area Add Files to Staging Area git add -A or git add . (add all files) git add filename (add one single file) Remove files from Staging Area git reset (remove everything) git reset filename (remove one single file) 24
  • 25.
    Add a .gitignore Addgitignore file touch .gitignore or type nul > .gitignore Before first commit git status 25 Add gitignore file touch .gitignore or type nul > .gitignore
  • 26.
    26 Exercise 4: Committhe changes to go to the final stage (History) Scenario: You want to track the changes you made in the folder (part 2)
  • 27.
    Our first Gitcommit!! Our First Commit git commit -m “message goes here” Rules for messages: ✘ No period “.” ✘ < 50 characters ✘ Active voice and verbs 27
  • 28.
  • 29.
    The challenge: 29 ✘ Createa new file called misclass.html ✘ Add a new h1 and paragraph to your misclass.html file for “Favorite MIS Classes” ✘ Make the commit to your Git repo to track these changes!
  • 30.
  • 31.
    Let’s first talkabout GitHub a little bit... 31
  • 32.
    What is GitHub? Acollaboration platform built on top of Git. It nurtures a community for developers and supports open source. GitHub = the Google Drive for the coding community!
  • 33.
    Overview of GitHub dashboard Let’sgo your GitHub account!
  • 34.
    The Process 34 4 COMMIT CHANGES ANDPUSH BACK TO REMOTE REPO 3 MAKE CHANGES LOCALLY 2 CLONE THE REPO TO YOUR LOCAL LAPTOP 1 CREATE A REMOTE REPO IN GITHUB
  • 35.
    35 Exercise 5: CreateA Remote Repo from GitHub Scenario: You want to track an existing, remote project using Git (p1)
  • 36.
    36 Exercise 6: Clonethis remote repo to your local git repo in your laptop Scenario: You want to track an existing, remote project using Git (p2)
  • 37.
    37 Exercise 7: Makechanges locally and push it to your remote GitHub repo Scenario: You want to track an existing, remote project using Git (p3)
  • 38.
    Work with aRemote Repo Cloning a remote repo git clone <url> <where to clone> 38 Push new changesCommit Changes Locally ● git status ● git add -A ● git commit -m “message” Update the remote repo
  • 39.
    Update the changesto remote repo Pull to update the remote repo git pull 39 Push new changes to the remote repo git push Push new changes ● git push Commit Changes Locally Update the remote repo ● git pull
  • 40.
  • 41.
  • 42.
  • 43.
    Github Desktop Installed applicationthat let’s us interact with Github without relying on a browser ● Same functions ● Easier than CLI ● Still free!
  • 44.
    GitHub Desktop isa GUI! 44 ● GUI (Graphical User Interface) is is a system of interactive components such as icons and other graphical objects that help a user interact with computer software, such as an operating system. ● Is considered to be more user-friendly than a text-based command-line interface (CLI)
  • 45.
    Benefits over Browser ✘Same Benefits ✘ GUI ✘ You need a git client to make changes ✘ No Command Line 45
  • 46.
    46 Exercise 8: UseGitHub Desktop to clone a remote repo Scenario: You want to use an open-source project
  • 47.
    What we’re gonnado: 47 ✘ Clone a remote Repo ✘ Manipulate Pre-Written Code - Tell us about yourself! ✘ Make it your own Repo
  • 48.
    Getting Started: 48 ✘ Navigateto Nhi’s repo: https://github.com/nhi-ng/blogtemplate.git ✘ Clone the remote repo ✘ Edit Code in Visual Studio Code ✘ Push it back to your own GitHub account
  • 49.
    49 Exercise 9: Makechanges and create new repo using GitHub Desktop Scenario: You want to upload your code to GitHub
  • 50.
  • 51.
    Let’s go towww.kahoot.it 51
  • 52.
    52 Track changes infolders and files Git commands Understand Git Try GitHub Desktop Create your first remote repo
  • 53.
  • 54.
    54 ● GitHub Tutorialfor Beginners: Command-Line Fundamentals ○ https://www.youtube.com/watch?v=HVsySz-h9r4 ● LinkedIn Learning: Version Control and Collaboration with GitHub ○ https://www.linkedin.com/learning/learning-github/version-cont rol-and-collaboration-with-github?u=2206009 ● GitHub Learning Lab ○ https://lab.github.com/
  • 55.
  • 56.
    56 Thanks for coming! SuitableCode AIS Attendance http://bit.ly/TD-SAT3 Exit Code: gitiful