GitHub Presentation 1
GitHub Presentation 1
GitHub Presentation 1
Demo 2
Introduction
First there was an ad hoc approach (copy dirs)
Then local version control systems (VCSs)
Then centralized (means there is a server)
CVS, SVN
Why version control?
Committing” a change simply means Micro commits possible (two step commit)
recording the change in the central
system.
Example: CVS, Subversion (or SVN) and Example Git , Mercurial , BitKeeper
5
Perforce. Bazaar, Darcs
Git and GitHub
Git is a DVC tool that is used to store different
versions of a file in a remote or local
repository.
Git is a specific open-source version control
system created by Linus Torvalds in 2005.
commonly used for open source and
commercial software development.
According to a Stack Overflow developer
survey, over 87% of developers use Git.
Command-Line Tool (accessible with Terminal on the
Mac or Git Bash on Windows)
6
Groups of Git commands
Setup and branch management
init, checkout, branch
Modify
add, delete, rename, commit
Get information
status, diff, log
Create reference points
tag, branch
Basic Git concepts
clone: Clone remote repository (and its full history) to
your computer
stage: Place a file in the staging area
commit: Place a file in the git directory (repository)
push: Update remote repository using local repository
pull: Update local repository using remote repository
add: Start tracking a new file, or stage a modified file
branch: An end point in the commit tree
fork: A copy of another repository for reuse
merge: Combine two commits 8
Basic Git Commands
git init – Initialize a Git repository/working
directory
git status – Status of your working directory
git add <filename> or git add . (for all files in your
working directory)
git commit – Stash changes in your working
directory
git log –online – View your commit history
git clone – Create an identical copy
9
Cont..
git push – push your changes into the remote
repository
git pull – pull your latest changes from the
remote repository
git branch – view branches in your repository
git branch <branchname> - create a branch
git checkout <branchname> - move to that
branch
git merge <branchname> - merge into that
branch
git revert <commit sha> 10
GitHub
hosting medium/website for your Git
repositories
Offers powerful collaborative abilities
A good indicator of what you code/how
much you code/quality of your code
GitHub is a code hosting platform for version
control and collaboration.
It lets you and others work together on projects
from anywhere.
11
The difference between Git and GitHub
Git GitHub
a revision control system, a GitHub is a website and cloud-
tool to manage your source based service that helps
code history developers store and manage
their code,
Git for version control and cloud-based Git repository
collaboration. hosting service.
Git client so that can use A good indicator of what you
SSH to pull down your own Git code/how much you
repository from GitHub (or code/quality of your code
other similar services).
work offline most of the time GitHub provides a Web-
based graphical interface.
12
Git is a command line tool,
Basic components of GitHub
1. A repository is usually used to organize a single
project that can contain folders and files, images,
videos, spreadsheets, and data sets
2. Branching is the way to work on different versions
of a repository at one time.
3. commit :On GitHub, saved changes are
called commits.
4. Pull Requests is heart of collaboration on GitHub.
proposing changes and requesting that someone
review and pull in contribution and merge them into
their branch
5. Merge your Pull Request: it's time to bring
changes together – merging created branch into
the master branch. 13
Some basic Terminology
git = the shell command to work with Git
repo = Repository, where the code for a
given project is kept
commit = verb, means push the code to the
server (in Git, commit = (commit + push)
diff = the difference between two versions of
a file
SSH = Secure SHell – Network protocol for
communication between machines
RSA = Rivest, Shamir, Adleman – public-key
cryptography algorithm
14
Demo GitHub
15
16