SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
Introduction to Git
What is Git and Github?
Git is an extremely fast, efficient, distributed
version control system used for collaborative
development of software. Git was designed and
developed by Linus Torvalds.

Github is a web based hosting service for
software development projects that use the Git
revision control system.
Working with Git locally
● Creating Projects

            $ git init

● Adding Files to Staging Area

    $ git add . (add all files
  recursively)

     $ git add * (add all files)
Working with Git locally




● Checking the status of the project

        $ git status
Working with Git locally
● Committing changes

  $ git commit -m 'first commit'
Git Branching
Git Branching
● Branch Command

  $ git branch [branchname]
  (creates a branch)

  $git checkout [branchname]
  (switch to another branch)
Git Branching
  $git branch
  (lists existing branch)

● Merge branch

  $git merge [branchname]

● Read the commit history

  $git   log
Working remotely with git
Working remotely with Git
Working remotely with Git
● Getting the copy of repository

  $git clone [url]

● Adding a remote repository

  $ git remote add [alias] [url]
Working remotely with Git
● Updating from a remote repository

  $ git pull

● Updating a remote repository

     $git push [alias] [branch]
Best practices
●   Always do small, logical commits
●   Do keep up to date
●   Always review code before committing it
●   Do useful tools (eg. sourcetree)

Más contenido relacionado

La actualidad más candente

CloudOps DevOps Montreal: Gitlab
CloudOps DevOps Montreal: GitlabCloudOps DevOps Montreal: Gitlab
CloudOps DevOps Montreal: GitlabCloudOps2005
 
A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to GitDaniel Tai
 
Git, github and the hacktober fest
Git, github and the hacktober festGit, github and the hacktober fest
Git, github and the hacktober festUtkarshRaj83
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How tolanhuonga3
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with gitgdgjss
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
 
Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1ahmadezzeir
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 WorkshopJoy Seng
 
Git locally git rm/revert/reset
Git locally git rm/revert/resetGit locally git rm/revert/reset
Git locally git rm/revert/resetahmadezzeir
 

La actualidad más candente (20)

Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
CloudOps DevOps Montreal: Gitlab
CloudOps DevOps Montreal: GitlabCloudOps DevOps Montreal: Gitlab
CloudOps DevOps Montreal: Gitlab
 
A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to Git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git, github and the hacktober fest
Git, github and the hacktober festGit, github and the hacktober fest
Git, github and the hacktober fest
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git: Git'ing the Basic
Git: Git'ing the BasicGit: Git'ing the Basic
Git: Git'ing the Basic
 
Formation git
Formation gitFormation git
Formation git
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Git and github
Git and githubGit and github
Git and github
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
 
Git locally git rm/revert/reset
Git locally git rm/revert/resetGit locally git rm/revert/reset
Git locally git rm/revert/reset
 

Similar a Introduction To Git

Similar a Introduction To Git (20)

introductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdfintroductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdf
 
Git github
Git githubGit github
Git github
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
 
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucketIntro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
 
Git
GitGit
Git
 
Git presentation
Git presentationGit presentation
Git presentation
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
github_gyan.pptx
github_gyan.pptxgithub_gyan.pptx
github_gyan.pptx
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGit_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_Guidewire
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Day 2_ Get Git with It! A Developer's Workshop.pptx
Day 2_ Get Git with It! A Developer's Workshop.pptxDay 2_ Get Git with It! A Developer's Workshop.pptx
Day 2_ Get Git with It! A Developer's Workshop.pptx
 
Git & Github
Git & GithubGit & Github
Git & Github
 
GITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubGITHappens, powerpoint about git and github
GITHappens, powerpoint about git and github
 

Introduction To Git

  • 2. What is Git and Github? Git is an extremely fast, efficient, distributed version control system used for collaborative development of software. Git was designed and developed by Linus Torvalds. Github is a web based hosting service for software development projects that use the Git revision control system.
  • 3. Working with Git locally ● Creating Projects $ git init ● Adding Files to Staging Area $ git add . (add all files recursively) $ git add * (add all files)
  • 4. Working with Git locally ● Checking the status of the project $ git status
  • 5. Working with Git locally ● Committing changes $ git commit -m 'first commit'
  • 7. Git Branching ● Branch Command $ git branch [branchname] (creates a branch) $git checkout [branchname] (switch to another branch)
  • 8. Git Branching $git branch (lists existing branch) ● Merge branch $git merge [branchname] ● Read the commit history $git log
  • 11. Working remotely with Git ● Getting the copy of repository $git clone [url] ● Adding a remote repository $ git remote add [alias] [url]
  • 12. Working remotely with Git ● Updating from a remote repository $ git pull ● Updating a remote repository $git push [alias] [branch]
  • 13. Best practices ● Always do small, logical commits ● Do keep up to date ● Always review code before committing it ● Do useful tools (eg. sourcetree)