SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Git
distributed version control system
          Wei-Tsung Lin
Introduction
● Git is a open source distributed version
  control system designed to handle
  everything from small to large projects with
  speed and efficiency.
● Create a branch to test new features,
  commit many times, and roll back to where
  you branched from.
● Have a master branch that contains only the
  content go to the production, another that
  you merge work for testing, and several tiny
  changes for nightly build.
Distributed
● Git is a distributed system, which means that
  instead of doing "checkout" of source code
  every times, you can have your own clone of
  the entire repository.
● You can work on the projects without
  Internet, and then commit your works after
  you get connection.
● Only "add" action is implemented, so you
  can restore everything which has existed in
  your repository.
Enviroment
● You can get Git from most package manager
  in Linux system.
● Under Windows, you can use MSysGit.

●   git config --global user.name "name"
●   git config --global user.email "email"
●   git config --global apply.whitespace nowarn
●   git config --global color.ui true
Initialize
● Create new repository
  Find a empty directory, and execute
  command: "git init", initialize empty Git
  repository in directory ".git".

● Clone a repository
  Command: "git clone url"
Basic usage




touch README git add README git commit -m "README"
unstage      stage          commit
Commit log
● Console: git log
● Windows: TortoiseGit
● Linux:
  giggle
● Mac:
  GitX
Branch
● Commits are Identified by SHA.
● Master means which branch we are working
  on.
● "git checkout" to change branch
Example
Merge




git checkout master
git merge issue1
Rebase




git checkout hotfix
git rebase master
Reference
http://progit.org/

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for Implementation
 
GitOps with Gitkube
GitOps with GitkubeGitOps with Gitkube
GitOps with Gitkube
 
Github
GithubGithub
Github
 
Git Workshop
Git WorkshopGit Workshop
Git Workshop
 
CICD pipelines with GitOps
CICD pipelines with GitOpsCICD pipelines with GitOps
CICD pipelines with GitOps
 
Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucket
 
Git & github
Git & githubGit & github
Git & github
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Intro to Git
Intro to GitIntro to Git
Intro to Git
 
Bitbucket and Git
Bitbucket and GitBitbucket and Git
Bitbucket and Git
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
 
Intro to Git & GitHub
Intro to Git & GitHubIntro to Git & GitHub
Intro to Git & GitHub
 
From Java Monolith to k8s with CI/CD
From Java Monolith to k8s with CI/CD From Java Monolith to k8s with CI/CD
From Java Monolith to k8s with CI/CD
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhub
 
Git kelvin
Git   kelvinGit   kelvin
Git kelvin
 
Git hub
Git hubGit hub
Git hub
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)
 
Git presentation
Git presentationGit presentation
Git presentation
 

Destacado

A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to GitDaniel Tai
 
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopOpen Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopWong Hoi Sing Edison
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
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 guideRohit 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
 

Destacado (8)

A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to Git
 
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopOpen Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
 
Github basics
Github basicsGithub basics
Github basics
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
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
 

Similar a Git tutorial

Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumAbhijitNarayan2
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.WordCamp Harare
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfGDSCKNUST
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboardsDenis Ristic
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!Cory Webb
 
An introductory guide to GIT
An introductory guide to GITAn introductory guide to GIT
An introductory guide to GITAmith jayasekara
 

Similar a Git tutorial (20)

Gn unify git
Gn unify gitGn unify git
Gn unify git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
Open source
Open sourceOpen source
Open source
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git
GitGit
Git
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Git & Github
Git & GithubGit & Github
Git & Github
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Version control
Version controlVersion control
Version control
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
An introductory guide to GIT
An introductory guide to GITAn introductory guide to GIT
An introductory guide to GIT
 

Git tutorial

  • 1. Git distributed version control system Wei-Tsung Lin
  • 2. Introduction ● Git is a open source distributed version control system designed to handle everything from small to large projects with speed and efficiency. ● Create a branch to test new features, commit many times, and roll back to where you branched from. ● Have a master branch that contains only the content go to the production, another that you merge work for testing, and several tiny changes for nightly build.
  • 3. Distributed ● Git is a distributed system, which means that instead of doing "checkout" of source code every times, you can have your own clone of the entire repository. ● You can work on the projects without Internet, and then commit your works after you get connection. ● Only "add" action is implemented, so you can restore everything which has existed in your repository.
  • 4. Enviroment ● You can get Git from most package manager in Linux system. ● Under Windows, you can use MSysGit. ● git config --global user.name "name" ● git config --global user.email "email" ● git config --global apply.whitespace nowarn ● git config --global color.ui true
  • 5. Initialize ● Create new repository Find a empty directory, and execute command: "git init", initialize empty Git repository in directory ".git". ● Clone a repository Command: "git clone url"
  • 6. Basic usage touch README git add README git commit -m "README" unstage stage commit
  • 7. Commit log ● Console: git log ● Windows: TortoiseGit ● Linux: giggle ● Mac: GitX
  • 8. Branch ● Commits are Identified by SHA. ● Master means which branch we are working on. ● "git checkout" to change branch