SlideShare a Scribd company logo
GitHub Basics
Derek Babel 2017 spring
Github: DerekBable
GitHub Basics
- HOW TO SET UP A GITHUB ACCOUNT AND ADD THE STUDENT DEVELOPER PACK
(WHICH GRANTS UNLIMITED FREE PRIVATE REPOSITORIES).
- SOME BASIC TERMINOLOGY
- SOME BASIC TUTORIALS ON HOW TO MANAGE GITHUB REPOSITORIES, BOTH ON THE
WEB AND WITH THE COMMAND LINE.
Some Terminology
 Repository
 A sort of "file system" with version control in which files can be uploaded to.
 Local Repository
 A repository that exists on a computer's (your computer's) hard drive.
 Remote Repository
 A repository that exists on a server's (in this case, GitHub's servers) storage.
 Private Repository
 A remote repository that is not browsable on GitHub.com by anyone except the
repository owner and contributors (as defined by the owner) of the repository.
 Public Repository
 A remote repository that is browsable on GitHub.com by anyone, but the owner or
contributors must approve commits to the repository.
Creating a GitHub Account and Adding
the Student Developer Pack
 Go to GitHub.com
 In the text boxes in the middle of the screen, enter the following
information:
 Pick a username: the user name you want associated with your GitHub account,
as well as displayed with any commits you make to repositories.
 Your email address: the email you want associated with your account (you can
use your YSU email, but you don't have to), also shown on commits.
 Password: the password you want associated with your account.
1
GitHub Basics - Derek Bable
Creating a GitHub Account and Adding
the Student Developer Pack
 On the "Choose your personal plan" page, leave "Unlimited public
repositories for free" checked, click continue.
 Enter information relevent to you and click next, or click "Skip this step"
2
GitHub Basics - Derek Bable
Creating a GitHub Account and Adding
the Student Developer Pack
 Go to https://education.github.com/pack, click "Get your pack"
 Click "Yes, I'm a student"
 Enter the information as it applies to you, click "Submit Request"
 If you did not use your YSU email for your GitHub account, you will need to
follow the steps to add it as a contact for your GitHub account.
 You should receive an email saying that your account was upgraded with
the Student Developer Pack. You can now create private repositories.
 Note, this may take some time. It took a few hours for me, but can take days.
3
Creating a New GitHub Repository
 Go to GitHub.com and sign in with your account username and password
 Click "Start a Project"
 Select the options you want for your repository, click "Create Repository"
 You should initialize your project with a readme if creating a new repository.
The readme displays on the main page of your repository.
1
GitHub Basics - Derek Bable
Creating a New GitHub Repository
 After clicking create, you just made your initial commit to your repository.
Now, you can manage your repository on the Web, or using Git on the
command line.
2
Some Terminology (Git)
 Commits
 Commits are the way in which you update changes to files in your repository.
After making a change to a file, you need to commit it in order for the changes
to be reflected in your repository.
 Push
 Push refers to pushing committed changes from your local repository to your
server repository. IF you don't have any changes committed in your local
repository and you try to push, nothing will happen.
 Pull
 Pull refers to pulling changes from a remote repository to your local repository.
1
Some Terminology (Git)
 Merge Conflicts / Conflicts
 Conflicts arise when multiple commits have been made to a file which conflict
with eachother. Conflicts can be carefully resolved as to make sure the files are
in tact and correctly updated.
 You probably won't have many conflicts if you are the only one working on your
repository.
2
Some Terminology (Git)
 Branches
 When you create a repository, you create one branch, the master branch. You
can create other branches to keep a separate "folder" for other code.
 By convention, the Master Branch is supposed to be an always working code branch.
If you branch from Master, you get a copy of the content's of Master into the branch
you just created.
 Branching is done to add new or experimental features to existing code in a way that
does not ruin the main branch of code.
 Pull Requests
 You can generate a pull request to pull a branch into master.
3
Managing a GitHub Repository (Web)
 Commits on the Web
 If you edit a file on GitHub.com, you can simply choose to commit and push the
file to the branch you are in at the bottom of the file editor page.
 Pushing and Pulling on the Web
 Depending on how you are changing files on the Web, remember, you are
working with the remote repository, so once you commit a change, your
repository is immediately updated with the change, you do not need to push in
this case.
 You can create pull requests on the Web to pull branches into one another.
1
Managing a GitHub Repository (Web)
 Adding Collaborators to a Repository
 When at the main page of a repository you own, you can add collaborators
by clicking the '+' icon in the top right of the page and click "New
Collaborator"
 You will then enter the username of the person's GitHub account that you want
to add.
 You probably want to add Dr. Yu, his username is: fenggeorgeyu
2
Managing a GitHub Repository
(Command Line)
 This guide assumes you are using Windows as an Operating System. Git is
available for other platforms, but the installation will differ. Once you have Git
installed, the "Using Git" section is universal.
 Get Git
 Go to https://git-scm.com/ and download Git for your OS (Windows was used for this
guide with Git version 2.11.0)
 Pick your architecture (I recommend against the portable version unless you
know what you are doing) [64-Bit was used for this guide].
 Run the installer you downloaded
 "Git-2.11.0.3-64-bit.exe" was used for this guide.
 You can simply leave everything as default in the installation procedure. If you
change settings, you will need to account for them later in this guide.
1
Managing a GitHub Repository
(Command Line)
 You will notice that there are multiple programs that were installed relating
to Git: 1) Git GUI: A graphical interface for creating, cloning, and opening
repositories. 2) Git CMD: A command line (Windows) type interface for
using Git. 3) Git Bash: A Unix type interface for using Git.
 Here, I will use Git Bash, but Git CMD works very similarly.
 If using Linux, use one of the following commands to install Git based on
your Linux Distribution:
 Debian/Ubuntu
 sudo apt-get install git (or, if you are root, simply: apt-get install git)
2
Managing a GitHub Repository
(Command Line)
 Linux Fedora
 yum install git (up to Fedora 21)
 dnf install git (Fedora 22 and later)
 Gentoo
 emerge --ask --verbose dev-vcs/git
 Arch Linux
 pacman -S git
 openSUSE
 zypper install git
3
Managing a GitHub Repository
(Command Line)
 FreeBSD
 cd /usr/ports/devel/git
 make install
 Solaris 9/10/11 (OpenCSW)
 pkgutil -i git
 Solaris 11 Express
 pkg install developer/versioning/git
 OpenBSD
 pkg_add git
 Alpine
 apk add git
4
Managing a GitHub Repository
(Command Line): Cloning a Repo
 Git Bash (Cloning a Repository)
 Assuming that you created a repository online, you can now use Git to
clone your repository to your computer's hard drive.
 Open Git Bash
 Git Bash uses Unix (Linux, Ubuntu, etc) type commands (i.e. ls, mkdir, etc.)
 On open, Git Bash will put you into your C:Users**YourUserName folder.
 Create a new folder here (either with Windows Explorer or...) by typing
"mkdir 'nameOfFolder', where 'nameOfFolder' is the name of the folder you
want to create.
 For this guide, I used "mkdir MyRepository"
5
Managing a GitHub Repository
(Command Line): Cloning a Repo
 Now, we can clone a remote repository into our local repository (which will
be located in the directory we just created)
 Type: "git clone {pathToRemoteRepository} ./MyRepository"
 Here, {pathToRemoteRepository} will be the URL of the repository from GitHub
you want to clone, for example: https://github.com/DerekBable/CTL-Main-
Server
 For this guide, I used: "git clone https://github.com/DerekBable/CTL-Main-
Server ./MyRepository/"
 If necessary, you will be asked for GitHub credentials to clone the repository.
6
GitHub Basics - Derek Bable
Managing a GitHub Repository
(Command Line): Cloning a Repo
 Now, "cd" into the repository: "cd MyRepository"
 You will notice some extra text at the end of your current line in Command Line
that says "~/MyRepository (master)"
 This means your current directory is identified as a repository, and you are
currently in the master branch.
7
GitHub Basics - Derek Bable
Managing a GitHub Repository
(Command Line)
 While in a repository directory on your machine, you can use Git to
manage your local repository and push it to your remote repository.
8
Managing a GitHub Repository
(Command Line): Pull
 First, it's a good idea to pull any changes made since the last time you
pulled to your local repository.
 To do this, type "git pull"
 If the local and remote repositories are in sync already, you will get a return of
"Already up-to-date"
9
Managing a GitHub Repository
(Command Line): Create/Edit Files
 To create or edit files in a local repository, you can simply use File Explorer,
command line, or whatever means you wish, your local repository is
essentially the same as a normal directory on your machine.
 For example, open up your repository's directory in your File Explorer and
create a new file in it.
 For this guide, I created a new text document "Test.txt"
10
GitHub Basics - Derek Bable
Managing a GitHub Repository
(Command Line): Adding Files
 IMPORTANT: If you create a new file or folder like this, you
need to add that folder or file to Git.
 To do this, type "git add fileName.ext" where fileName.ext is the file
name and extension of the file you just created.
 For this guide, using the above example, "git add Test.txt"
11
Managing a GitHub Repository
(Command Line): Deleting Files
 If you just delete a file in File Explorer, Git will not
stop tracking the file, the file will just simply be
removed from your local repostiory and not your
remote repository. To remove a file from Git and get
it to stop tracking the file (so you can actally commit
the removed file), use "git rm" instead.
 For example, "git rm Test.txt"
12
Managing a GitHub Repository (Command Line): Adding
Files
Managing a GitHub Repository
(Command Line): Committing
 After you have changed your local repository in some way
(adding, removing, or editing a file) you need to commit your
changes to the repository, then push them to the remote
repository.
 To do this, make some changes to your repository (i.e. adding a file in
the above step) then type "git commit -m
{someShortMessageAboutWhatYouDid}"
 The "-m" flag adds a message to your commit. It is good practice to
include a message with every commit you do.
 For example, "git commit -m "Created Test.txt file."
13
Managing a GitHub Repository
(Command Line): Push
 After commiting changes to your local repository,
you need to push those changes to the remote
repostiory.
 To do this, type "git push“
 Now, if you go to your repository on the web, you will see
your commited changes take effect in your remote
repository.
14
Important Notes
 You should almost always pull before you start working with your repository.
 In almost every case, you need to commit before you push (or else no changes
will be reflected).
 Creating a new file in a File Explorer requires you to add the file to Git after
creation using “git add {file}”
 Deleting a file in a File Explorer will not remove the file from Git, instead, use
Git Bash and use “git rm {file}”

More Related Content

What's hot

Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Houari ZEGAI
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
SheilaJimenezMorejon
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
LeoulZewelde1
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
Krunal Doshi
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Yan Vugenfirer
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
Taisuke Inoue
 

What's hot (20)

Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git basics
Git basicsGit basics
Git basics
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git real slides
Git real slidesGit real slides
Git real slides
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git basic
Git basicGit basic
Git basic
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
 

Viewers also liked

Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
Lorna Mitchell
 
Git/GitHub
Git/GitHubGit/GitHub
Git/GitHub
Microsoft
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
SV Ruby on Rails Meetup
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Git and Github
Git and GithubGit and Github
Git and Github
Wen-Tien Chang
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
James Gray
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guide
Rohit Arora
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
Joel Krebs
 

Viewers also liked (9)

Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Git/GitHub
Git/GitHubGit/GitHub
Git/GitHub
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guide
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 

Similar to GitHub Basics - Derek Bable

A Tutorial for GitHub.pdf
A Tutorial for GitHub.pdfA Tutorial for GitHub.pdf
A Tutorial for GitHub.pdf
badrfathallah2
 
A Tutorial for GitHub.pdf
A Tutorial for GitHub.pdfA Tutorial for GitHub.pdf
A Tutorial for GitHub.pdf
Amarnadh36
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
Hitesh670643
 
Git
GitGit
Git/GitHub
Git/GitHubGit/GitHub
Git/GitHub
Cindy Royal
 
Git
GitGit
git.ppt
git.pptgit.ppt
git.ppt
ssuser10dcd71
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
Ashok Kumar Satuluri
 
16 Git
16 Git16 Git
Git
GitGit
Get your Git on GitHub
Get your Git on GitHubGet your Git on GitHub
Get your Git on GitHub
Runcy Oommen
 
Git Hub Platform
Git Hub PlatformGit Hub Platform
Git Hub Platform
Gaurav Ahluwalia
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
Jonathan Lawerh
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
Nyros Technologies
 
Getting started With GIT
Getting started With GITGetting started With GIT
Getting started With GIT
GhadiAlGhosh
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
Himanshu Agrawal
 
Git within RStudio
Git within RStudioGit within RStudio
Git within RStudio
PaulinaJedynakPhD
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github
SahilSonar4
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
HuthaifaAlmaqrami1
 
Git hub visualstudiocode
Git hub visualstudiocodeGit hub visualstudiocode
Git hub visualstudiocode
Rolands Krumbergs
 

Similar to GitHub Basics - Derek Bable (20)

A Tutorial for GitHub.pdf
A Tutorial for GitHub.pdfA Tutorial for GitHub.pdf
A Tutorial for GitHub.pdf
 
A Tutorial for GitHub.pdf
A Tutorial for GitHub.pdfA Tutorial for GitHub.pdf
A Tutorial for GitHub.pdf
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
Git
GitGit
Git
 
Git/GitHub
Git/GitHubGit/GitHub
Git/GitHub
 
Git
GitGit
Git
 
git.ppt
git.pptgit.ppt
git.ppt
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
16 Git
16 Git16 Git
16 Git
 
Git
GitGit
Git
 
Get your Git on GitHub
Get your Git on GitHubGet your Git on GitHub
Get your Git on GitHub
 
Git Hub Platform
Git Hub PlatformGit Hub Platform
Git Hub Platform
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Getting started With GIT
Getting started With GITGetting started With GIT
Getting started With GIT
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Git within RStudio
Git within RStudioGit within RStudio
Git within RStudio
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Git hub visualstudiocode
Git hub visualstudiocodeGit hub visualstudiocode
Git hub visualstudiocode
 

More from "FENG "GEORGE"" YU

Constructing a Modern Information System for a Small Company: A Real Battle
Constructing a Modern Information System for a Small Company: A Real BattleConstructing a Modern Information System for a Small Company: A Real Battle
Constructing a Modern Information System for a Small Company: A Real Battle
"FENG "GEORGE"" YU
 
MySQL vs MonetDB Bencharmarks
MySQL vs MonetDB BencharmarksMySQL vs MonetDB Bencharmarks
MySQL vs MonetDB Bencharmarks
"FENG "GEORGE"" YU
 
Query Optimization - Brandon Latronica
Query Optimization - Brandon LatronicaQuery Optimization - Brandon Latronica
Query Optimization - Brandon Latronica
"FENG "GEORGE"" YU
 
MySQL vs. MonetDB
MySQL vs. MonetDBMySQL vs. MonetDB
MySQL vs. MonetDB
"FENG "GEORGE"" YU
 
Write Optimization of Column-Store Databases in Out-of-Core Environment
Write Optimization of Column-Store Databases in Out-of-Core EnvironmentWrite Optimization of Column-Store Databases in Out-of-Core Environment
Write Optimization of Column-Store Databases in Out-of-Core Environment
"FENG "GEORGE"" YU
 
Timestamped Binary Association Table - IEEE Big Data Congress 2015
Timestamped Binary Association Table - IEEE Big Data Congress 2015Timestamped Binary Association Table - IEEE Big Data Congress 2015
Timestamped Binary Association Table - IEEE Big Data Congress 2015
"FENG "GEORGE"" YU
 

More from "FENG "GEORGE"" YU (6)

Constructing a Modern Information System for a Small Company: A Real Battle
Constructing a Modern Information System for a Small Company: A Real BattleConstructing a Modern Information System for a Small Company: A Real Battle
Constructing a Modern Information System for a Small Company: A Real Battle
 
MySQL vs MonetDB Bencharmarks
MySQL vs MonetDB BencharmarksMySQL vs MonetDB Bencharmarks
MySQL vs MonetDB Bencharmarks
 
Query Optimization - Brandon Latronica
Query Optimization - Brandon LatronicaQuery Optimization - Brandon Latronica
Query Optimization - Brandon Latronica
 
MySQL vs. MonetDB
MySQL vs. MonetDBMySQL vs. MonetDB
MySQL vs. MonetDB
 
Write Optimization of Column-Store Databases in Out-of-Core Environment
Write Optimization of Column-Store Databases in Out-of-Core EnvironmentWrite Optimization of Column-Store Databases in Out-of-Core Environment
Write Optimization of Column-Store Databases in Out-of-Core Environment
 
Timestamped Binary Association Table - IEEE Big Data Congress 2015
Timestamped Binary Association Table - IEEE Big Data Congress 2015Timestamped Binary Association Table - IEEE Big Data Congress 2015
Timestamped Binary Association Table - IEEE Big Data Congress 2015
 

Recently uploaded

leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
alexjohnson7307
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
shyamraj55
 
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
aslasdfmkhan4750
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
SAI KAILASH R
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Torry Harris
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
bhumivarma35300
 
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
Priyanka Aash
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Networks
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
softsuave
 
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptxMAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
janagijoythi
 
Google I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged SlidesGoogle I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged Slides
Google Developer Group - Harare
 
Feature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptxFeature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptx
ssuser1915fe1
 
Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10
ankush9927
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Muhammad Ali
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
Baishakhi Ray
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
bellared2
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
SynapseIndia
 
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
Priyanka Aash
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
DianaGray10
 

Recently uploaded (20)

leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
 
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
 
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
 
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptxMAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
 
Google I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged SlidesGoogle I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged Slides
 
Feature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptxFeature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptx
 
Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
 
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
 

GitHub Basics - Derek Bable

  • 1. GitHub Basics Derek Babel 2017 spring Github: DerekBable
  • 2. GitHub Basics - HOW TO SET UP A GITHUB ACCOUNT AND ADD THE STUDENT DEVELOPER PACK (WHICH GRANTS UNLIMITED FREE PRIVATE REPOSITORIES). - SOME BASIC TERMINOLOGY - SOME BASIC TUTORIALS ON HOW TO MANAGE GITHUB REPOSITORIES, BOTH ON THE WEB AND WITH THE COMMAND LINE.
  • 3. Some Terminology  Repository  A sort of "file system" with version control in which files can be uploaded to.  Local Repository  A repository that exists on a computer's (your computer's) hard drive.  Remote Repository  A repository that exists on a server's (in this case, GitHub's servers) storage.  Private Repository  A remote repository that is not browsable on GitHub.com by anyone except the repository owner and contributors (as defined by the owner) of the repository.  Public Repository  A remote repository that is browsable on GitHub.com by anyone, but the owner or contributors must approve commits to the repository.
  • 4. Creating a GitHub Account and Adding the Student Developer Pack  Go to GitHub.com  In the text boxes in the middle of the screen, enter the following information:  Pick a username: the user name you want associated with your GitHub account, as well as displayed with any commits you make to repositories.  Your email address: the email you want associated with your account (you can use your YSU email, but you don't have to), also shown on commits.  Password: the password you want associated with your account. 1
  • 6. Creating a GitHub Account and Adding the Student Developer Pack  On the "Choose your personal plan" page, leave "Unlimited public repositories for free" checked, click continue.  Enter information relevent to you and click next, or click "Skip this step" 2
  • 8. Creating a GitHub Account and Adding the Student Developer Pack  Go to https://education.github.com/pack, click "Get your pack"  Click "Yes, I'm a student"  Enter the information as it applies to you, click "Submit Request"  If you did not use your YSU email for your GitHub account, you will need to follow the steps to add it as a contact for your GitHub account.  You should receive an email saying that your account was upgraded with the Student Developer Pack. You can now create private repositories.  Note, this may take some time. It took a few hours for me, but can take days. 3
  • 9. Creating a New GitHub Repository  Go to GitHub.com and sign in with your account username and password  Click "Start a Project"  Select the options you want for your repository, click "Create Repository"  You should initialize your project with a readme if creating a new repository. The readme displays on the main page of your repository. 1
  • 11. Creating a New GitHub Repository  After clicking create, you just made your initial commit to your repository. Now, you can manage your repository on the Web, or using Git on the command line. 2
  • 12. Some Terminology (Git)  Commits  Commits are the way in which you update changes to files in your repository. After making a change to a file, you need to commit it in order for the changes to be reflected in your repository.  Push  Push refers to pushing committed changes from your local repository to your server repository. IF you don't have any changes committed in your local repository and you try to push, nothing will happen.  Pull  Pull refers to pulling changes from a remote repository to your local repository. 1
  • 13. Some Terminology (Git)  Merge Conflicts / Conflicts  Conflicts arise when multiple commits have been made to a file which conflict with eachother. Conflicts can be carefully resolved as to make sure the files are in tact and correctly updated.  You probably won't have many conflicts if you are the only one working on your repository. 2
  • 14. Some Terminology (Git)  Branches  When you create a repository, you create one branch, the master branch. You can create other branches to keep a separate "folder" for other code.  By convention, the Master Branch is supposed to be an always working code branch. If you branch from Master, you get a copy of the content's of Master into the branch you just created.  Branching is done to add new or experimental features to existing code in a way that does not ruin the main branch of code.  Pull Requests  You can generate a pull request to pull a branch into master. 3
  • 15. Managing a GitHub Repository (Web)  Commits on the Web  If you edit a file on GitHub.com, you can simply choose to commit and push the file to the branch you are in at the bottom of the file editor page.  Pushing and Pulling on the Web  Depending on how you are changing files on the Web, remember, you are working with the remote repository, so once you commit a change, your repository is immediately updated with the change, you do not need to push in this case.  You can create pull requests on the Web to pull branches into one another. 1
  • 16. Managing a GitHub Repository (Web)  Adding Collaborators to a Repository  When at the main page of a repository you own, you can add collaborators by clicking the '+' icon in the top right of the page and click "New Collaborator"  You will then enter the username of the person's GitHub account that you want to add.  You probably want to add Dr. Yu, his username is: fenggeorgeyu 2
  • 17. Managing a GitHub Repository (Command Line)  This guide assumes you are using Windows as an Operating System. Git is available for other platforms, but the installation will differ. Once you have Git installed, the "Using Git" section is universal.  Get Git  Go to https://git-scm.com/ and download Git for your OS (Windows was used for this guide with Git version 2.11.0)  Pick your architecture (I recommend against the portable version unless you know what you are doing) [64-Bit was used for this guide].  Run the installer you downloaded  "Git-2.11.0.3-64-bit.exe" was used for this guide.  You can simply leave everything as default in the installation procedure. If you change settings, you will need to account for them later in this guide. 1
  • 18. Managing a GitHub Repository (Command Line)  You will notice that there are multiple programs that were installed relating to Git: 1) Git GUI: A graphical interface for creating, cloning, and opening repositories. 2) Git CMD: A command line (Windows) type interface for using Git. 3) Git Bash: A Unix type interface for using Git.  Here, I will use Git Bash, but Git CMD works very similarly.  If using Linux, use one of the following commands to install Git based on your Linux Distribution:  Debian/Ubuntu  sudo apt-get install git (or, if you are root, simply: apt-get install git) 2
  • 19. Managing a GitHub Repository (Command Line)  Linux Fedora  yum install git (up to Fedora 21)  dnf install git (Fedora 22 and later)  Gentoo  emerge --ask --verbose dev-vcs/git  Arch Linux  pacman -S git  openSUSE  zypper install git 3
  • 20. Managing a GitHub Repository (Command Line)  FreeBSD  cd /usr/ports/devel/git  make install  Solaris 9/10/11 (OpenCSW)  pkgutil -i git  Solaris 11 Express  pkg install developer/versioning/git  OpenBSD  pkg_add git  Alpine  apk add git 4
  • 21. Managing a GitHub Repository (Command Line): Cloning a Repo  Git Bash (Cloning a Repository)  Assuming that you created a repository online, you can now use Git to clone your repository to your computer's hard drive.  Open Git Bash  Git Bash uses Unix (Linux, Ubuntu, etc) type commands (i.e. ls, mkdir, etc.)  On open, Git Bash will put you into your C:Users**YourUserName folder.  Create a new folder here (either with Windows Explorer or...) by typing "mkdir 'nameOfFolder', where 'nameOfFolder' is the name of the folder you want to create.  For this guide, I used "mkdir MyRepository" 5
  • 22. Managing a GitHub Repository (Command Line): Cloning a Repo  Now, we can clone a remote repository into our local repository (which will be located in the directory we just created)  Type: "git clone {pathToRemoteRepository} ./MyRepository"  Here, {pathToRemoteRepository} will be the URL of the repository from GitHub you want to clone, for example: https://github.com/DerekBable/CTL-Main- Server  For this guide, I used: "git clone https://github.com/DerekBable/CTL-Main- Server ./MyRepository/"  If necessary, you will be asked for GitHub credentials to clone the repository. 6
  • 24. Managing a GitHub Repository (Command Line): Cloning a Repo  Now, "cd" into the repository: "cd MyRepository"  You will notice some extra text at the end of your current line in Command Line that says "~/MyRepository (master)"  This means your current directory is identified as a repository, and you are currently in the master branch. 7
  • 26. Managing a GitHub Repository (Command Line)  While in a repository directory on your machine, you can use Git to manage your local repository and push it to your remote repository. 8
  • 27. Managing a GitHub Repository (Command Line): Pull  First, it's a good idea to pull any changes made since the last time you pulled to your local repository.  To do this, type "git pull"  If the local and remote repositories are in sync already, you will get a return of "Already up-to-date" 9
  • 28. Managing a GitHub Repository (Command Line): Create/Edit Files  To create or edit files in a local repository, you can simply use File Explorer, command line, or whatever means you wish, your local repository is essentially the same as a normal directory on your machine.  For example, open up your repository's directory in your File Explorer and create a new file in it.  For this guide, I created a new text document "Test.txt" 10
  • 30. Managing a GitHub Repository (Command Line): Adding Files  IMPORTANT: If you create a new file or folder like this, you need to add that folder or file to Git.  To do this, type "git add fileName.ext" where fileName.ext is the file name and extension of the file you just created.  For this guide, using the above example, "git add Test.txt" 11
  • 31. Managing a GitHub Repository (Command Line): Deleting Files  If you just delete a file in File Explorer, Git will not stop tracking the file, the file will just simply be removed from your local repostiory and not your remote repository. To remove a file from Git and get it to stop tracking the file (so you can actally commit the removed file), use "git rm" instead.  For example, "git rm Test.txt" 12 Managing a GitHub Repository (Command Line): Adding Files
  • 32. Managing a GitHub Repository (Command Line): Committing  After you have changed your local repository in some way (adding, removing, or editing a file) you need to commit your changes to the repository, then push them to the remote repository.  To do this, make some changes to your repository (i.e. adding a file in the above step) then type "git commit -m {someShortMessageAboutWhatYouDid}"  The "-m" flag adds a message to your commit. It is good practice to include a message with every commit you do.  For example, "git commit -m "Created Test.txt file." 13
  • 33. Managing a GitHub Repository (Command Line): Push  After commiting changes to your local repository, you need to push those changes to the remote repostiory.  To do this, type "git push“  Now, if you go to your repository on the web, you will see your commited changes take effect in your remote repository. 14
  • 34. Important Notes  You should almost always pull before you start working with your repository.  In almost every case, you need to commit before you push (or else no changes will be reflected).  Creating a new file in a File Explorer requires you to add the file to Git after creation using “git add {file}”  Deleting a file in a File Explorer will not remove the file from Git, instead, use Git Bash and use “git rm {file}”