SlideShare a Scribd company logo
Git (and github) for stand alone use
Ikuru K
What is git?
● A better version control system
● Freely available and open source
● What are version control systems good for?
Google it!
Brief history
● Linux project was initially using the bit keeper service, but
one of the contributors reverse engineered the protocol,
and made the provider angry, and Linux project got
banned from using the service.
● Linux's original author decided to make a version control
system that scales up with the project size, that also works
in a distributed manner.
● Linux original author passed the maintainer role to another
developer, and git has been evolving since.
Version control jargons
● Fluffy concept, but used frequently.
● Definitions are subjective, so feedback is
appreciated.
● Checkout/branch, commit, push, pull/merge.
Checkout/branch
● Point where change starts to be made
● Implication that it is always possible to return to
the checkout point, in case of some code
breakage that is not possible to recover.
Git repository, index, and
workspace.
● Changes made to your files exist in the
workspace.
● git add will move those changes to the index.
● Committing those changes will move whats in
the index to the repository object store.
● This three phase system allows the messy part
of the scratching prettier, and less garbage gets
committed as a result.
Commit
● In git context, a commit is a set of changes made to
the code base.
– More than a simple “save”
● Granularity is often subject of discussion
– If too much is changed in a single commit, then there is not
much point of it.
– If related changes are scattered across multiple commits,
life will be hard.
– Seems like work possible to be described in one sentence
is a good rule of thumb
Push
● Reflect the changes made by you to some
other entity. i.e. publish your commits
– Remote repository/ other person
– “Change made today will be pushed to production”
– “Please don't push garbage to our repository”
Pull
● Incorporate changes to a domain you have
control.
– If working on a local version of famous project
(MySql for instance), frequently pull changes.
Getting git on your machine
● For debian/ubuntu, $sudo apt-get install git
● For rhel/centos, look into yum
● For Windows and mac, respective clients are
available.
● (Google will explain this better)
Starting Project
● Create empty directory on file system
● Run $ git init
● Files and directories for git use will be created,
and git will track changes made to files created
in the file structure.
First commit ever
● Write a file, save.
● $ git status
– Will show files modified since last commit
● $ git diff
– Show line by line detail of the change since last commit.
● $ git add <filename>
– Tell git that file is ready to commit
● $ git commit -m “commit message”
– Officially commits the change
Too much has been modified since last commit,
and a simple commit msg cannot describe what
has been done?
● $ git add –patch <filename>
– Can interactively split up what gets staged to be
committed
Check what is to be committed
● $git commit -v
– Editor will open with detail of the commit detail.
– Write message and commit.
git rm --cached file.txt
● Use when you want to remove a file from the
repository, but want to keep in the file system.
● Also add such file to .gitignore file.
Remote/Github linkage
● All is lost if your PC blows, so remote repo is a
good idea.
● $git remote add origin <url of repository>
– Tells git where to push commits
● $git push origin master
– Push the commits to the remote repository
–
Checkout for stand alone use
● $git checkout <filename>
– Discard changes made since latest commit
– Good when you know program was working at the time when
latest commit was made
● $git checkout -b <branch name>
– Commits made after this will not affect the master branch
– The best habit is to always work on branches, and merge the
work from the master
– i.e. $git checkout master, followed by
$git merge <branch name>

More Related Content

PDF
How to store large binary files in git repositories
PDF
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
PPTX
Git basics
PPTX
Git basics
KEY
Helios in Action: Git at Eclipse
PDF
Git training with Devaamo
PPTX
Git training (basic)
PDF
Git in Eclipse
How to store large binary files in git repositories
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
Git basics
Git basics
Helios in Action: Git at Eclipse
Git training with Devaamo
Git training (basic)
Git in Eclipse

What's hot (20)

PPTX
PPT
Git Introduction
PPT
Git slides
PPTX
PPTX
Using Git and BitBucket
ODP
Git Workshop : Getting Started
PDF
Git Tutorial
PDF
Introduction to Git
PDF
Git and GitHub
PDF
Git basics
PPTX
Introduction to git
PDF
Intro to Git & GitHub
PDF
Brush up on using github
PPTX
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
PPTX
Introduction to git and Github
PPTX
Git and Github Session
PPTX
Git & git hub
PPTX
Git and github fundamentals
PDF
Contributing to open source using Git
PPTX
Git n git hub
Git Introduction
Git slides
Using Git and BitBucket
Git Workshop : Getting Started
Git Tutorial
Introduction to Git
Git and GitHub
Git basics
Introduction to git
Intro to Git & GitHub
Brush up on using github
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Introduction to git and Github
Git and Github Session
Git & git hub
Git and github fundamentals
Contributing to open source using Git
Git n git hub
Ad

Similar to Git for standalone use (20)

PPTX
Mini-training: Let’s Git It!
PDF
Git basics
ODP
The Fundamentals of Git
PPTX
Introduction to git and githhub with practicals.pptx
PPTX
Introduction to Git and Github
PPTX
Git Session 2K23.pptx
PPTX
Git and Github
PPTX
Git and github
PDF
Version control and GIT Primer
PDF
Git Mastery
PPTX
Introduction to git hub
PDF
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
PPTX
Git&GitHub.pptx
PPTX
GIT.pptx
PPTX
GitHub Event.pptx
PDF
Advanced Git Tutorial
PPT
Learn Git Basics
PDF
Git workshop
ODP
An introductory guide to GIT
PPTX
Techoalien git
Mini-training: Let’s Git It!
Git basics
The Fundamentals of Git
Introduction to git and githhub with practicals.pptx
Introduction to Git and Github
Git Session 2K23.pptx
Git and Github
Git and github
Version control and GIT Primer
Git Mastery
Introduction to git hub
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Git&GitHub.pptx
GIT.pptx
GitHub Event.pptx
Advanced Git Tutorial
Learn Git Basics
Git workshop
An introductory guide to GIT
Techoalien git
Ad

More from Ikuru Kanuma (20)

PDF
clj and deps.edn
PDF
Kukutei shinkoku with Clojure
PDF
Locarise,reagent and JavaScript Libraries
PDF
clara-rules
PDF
ClojureScript@node
PDF
Welcome to ClojureScript
PDF
Clojure web dev history
PDF
Arachne Unweaved (JP)
PDF
Clojureでガラケーサイトを作る際の細かい話
PPTX
Web forms made easy (with formative)
PDF
サムネイルを作る話
ODP
Review June2015 Dec2015
ODP
Redmine on amazon ec2
ODP
Engineering Ethics (In Japanese)
ODP
First Real Pull Request Ever
ODP
Pyunit
ODP
Review june2014 june2015
ODP
Elementary vim tricks
ODP
Processors in a nutshell
ODP
Computer hardware, and network
clj and deps.edn
Kukutei shinkoku with Clojure
Locarise,reagent and JavaScript Libraries
clara-rules
ClojureScript@node
Welcome to ClojureScript
Clojure web dev history
Arachne Unweaved (JP)
Clojureでガラケーサイトを作る際の細かい話
Web forms made easy (with formative)
サムネイルを作る話
Review June2015 Dec2015
Redmine on amazon ec2
Engineering Ethics (In Japanese)
First Real Pull Request Ever
Pyunit
Review june2014 june2015
Elementary vim tricks
Processors in a nutshell
Computer hardware, and network

Recently uploaded (20)

PPTX
Commmunication in Todays world- Principles and Barriers
PPTX
Understanding the Self power point presentation
PPTX
Learn how to prevent Workplace Incidents?
PPTX
Emotional Intelligence- Importance and Applicability
PPTX
cấu trúc sử dụng mẫu Cause - Effects.pptx
PPTX
Chapter-7-The-Spiritual-Self-.pptx-First
PPTX
diasspresentationndkcnskndncelklkfndc.pptx
PDF
The Zeigarnik Effect by Meenakshi Khakat.pdf
PPTX
Learn how to use Portable Grinders Safely
PDF
Top 10 Visionary Entrepreneurs to Watch in 2025
PPTX
UNIVERSAL HUMAN VALUES for NEP student .pptx
PPTX
THEORIES-PSYCH-3.pptx theory of Abraham Maslow
PPTX
How to Deal with Imposter Syndrome for Personality Development?
PDF
⚡ Prepping for grid failure_ 6 Must-Haves to Survive Blackout!.pdf
PPTX
show1- motivational ispiring positive thinking
PPTX
Travel mania in india needs to change the world
PDF
Elle Lalli on The Role of Emotional Intelligence in Entrepreneurship
PPTX
Learn about numerology and do tarot reading
PDF
SEX-GENDER-AND-SEXUALITY-LESSON-1-M (2).pdf
PPTX
Attitudes presentation for psychology.pptx
Commmunication in Todays world- Principles and Barriers
Understanding the Self power point presentation
Learn how to prevent Workplace Incidents?
Emotional Intelligence- Importance and Applicability
cấu trúc sử dụng mẫu Cause - Effects.pptx
Chapter-7-The-Spiritual-Self-.pptx-First
diasspresentationndkcnskndncelklkfndc.pptx
The Zeigarnik Effect by Meenakshi Khakat.pdf
Learn how to use Portable Grinders Safely
Top 10 Visionary Entrepreneurs to Watch in 2025
UNIVERSAL HUMAN VALUES for NEP student .pptx
THEORIES-PSYCH-3.pptx theory of Abraham Maslow
How to Deal with Imposter Syndrome for Personality Development?
⚡ Prepping for grid failure_ 6 Must-Haves to Survive Blackout!.pdf
show1- motivational ispiring positive thinking
Travel mania in india needs to change the world
Elle Lalli on The Role of Emotional Intelligence in Entrepreneurship
Learn about numerology and do tarot reading
SEX-GENDER-AND-SEXUALITY-LESSON-1-M (2).pdf
Attitudes presentation for psychology.pptx

Git for standalone use

  • 1. Git (and github) for stand alone use Ikuru K
  • 2. What is git? ● A better version control system ● Freely available and open source ● What are version control systems good for? Google it!
  • 3. Brief history ● Linux project was initially using the bit keeper service, but one of the contributors reverse engineered the protocol, and made the provider angry, and Linux project got banned from using the service. ● Linux's original author decided to make a version control system that scales up with the project size, that also works in a distributed manner. ● Linux original author passed the maintainer role to another developer, and git has been evolving since.
  • 4. Version control jargons ● Fluffy concept, but used frequently. ● Definitions are subjective, so feedback is appreciated. ● Checkout/branch, commit, push, pull/merge.
  • 5. Checkout/branch ● Point where change starts to be made ● Implication that it is always possible to return to the checkout point, in case of some code breakage that is not possible to recover.
  • 6. Git repository, index, and workspace. ● Changes made to your files exist in the workspace. ● git add will move those changes to the index. ● Committing those changes will move whats in the index to the repository object store. ● This three phase system allows the messy part of the scratching prettier, and less garbage gets committed as a result.
  • 7. Commit ● In git context, a commit is a set of changes made to the code base. – More than a simple “save” ● Granularity is often subject of discussion – If too much is changed in a single commit, then there is not much point of it. – If related changes are scattered across multiple commits, life will be hard. – Seems like work possible to be described in one sentence is a good rule of thumb
  • 8. Push ● Reflect the changes made by you to some other entity. i.e. publish your commits – Remote repository/ other person – “Change made today will be pushed to production” – “Please don't push garbage to our repository”
  • 9. Pull ● Incorporate changes to a domain you have control. – If working on a local version of famous project (MySql for instance), frequently pull changes.
  • 10. Getting git on your machine ● For debian/ubuntu, $sudo apt-get install git ● For rhel/centos, look into yum ● For Windows and mac, respective clients are available. ● (Google will explain this better)
  • 11. Starting Project ● Create empty directory on file system ● Run $ git init ● Files and directories for git use will be created, and git will track changes made to files created in the file structure.
  • 12. First commit ever ● Write a file, save. ● $ git status – Will show files modified since last commit ● $ git diff – Show line by line detail of the change since last commit. ● $ git add <filename> – Tell git that file is ready to commit ● $ git commit -m “commit message” – Officially commits the change
  • 13. Too much has been modified since last commit, and a simple commit msg cannot describe what has been done? ● $ git add –patch <filename> – Can interactively split up what gets staged to be committed
  • 14. Check what is to be committed ● $git commit -v – Editor will open with detail of the commit detail. – Write message and commit.
  • 15. git rm --cached file.txt ● Use when you want to remove a file from the repository, but want to keep in the file system. ● Also add such file to .gitignore file.
  • 16. Remote/Github linkage ● All is lost if your PC blows, so remote repo is a good idea. ● $git remote add origin <url of repository> – Tells git where to push commits ● $git push origin master – Push the commits to the remote repository –
  • 17. Checkout for stand alone use ● $git checkout <filename> – Discard changes made since latest commit – Good when you know program was working at the time when latest commit was made ● $git checkout -b <branch name> – Commits made after this will not affect the master branch – The best habit is to always work on branches, and merge the work from the master – i.e. $git checkout master, followed by $git merge <branch name>