Git introduction
Upcoming SlideShare
Loading in...5
×
 

Git introduction

on

  • 1,238 views

I was presenting an introduction to Git at Szegedtech

I was presenting an introduction to Git at Szegedtech

Statistics

Views

Total Views
1,238
Views on SlideShare
1,237
Embed Views
1

Actions

Likes
1
Downloads
14
Comments
0

1 Embed 1

http://coderwall.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Git introduction Git introduction Presentation Transcript

    • GitKornel Lugosi @CoornailMay 17, 2011
    • Table of contentsVersion controlDistributed revision controlRepositoryAdding, commitingTracking changesBranchesPushing, pullingSubmodulesRanges and other identifications of hashesOther fun stuffResources
    • Version control What?
    • Version control Why?
    • Version control Why?◮ Backup
    • Version control Why?◮ Backup◮ Revision handling
    • Version control Why?◮ Backup◮ Revision handling◮ Teamwork
    • Version control Why?◮ Backup◮ Revision handling◮ Teamwork◮ Organized code commit access and workflow
    • Version control Why?◮ Backup◮ Revision handling◮ Teamwork◮ Organized code commit access and workflow◮ Deploying
    • Version control How?
    • Version control How?◮ CVS
    • Version control How?◮ CVS◮ SVN
    • Version control How?◮ CVS◮ SVN◮ Hg(Mercurial)
    • Version control How?◮ CVS◮ SVN◮ Hg(Mercurial)◮ bzr (Bazaar)
    • Version control How?◮ CVS◮ SVN◮ Hg(Mercurial)◮ bzr (Bazaar)◮ ...
    • Version control How?◮ CVS◮ SVN◮ Hg(Mercurial)◮ bzr (Bazaar)◮ ...◮ Git
    • Distributed revision control
    • Repository(Repo)
    • Repository$ git init
    • Repository$ git init$ git init --bare
    • Repository$ git init$ git init --bare$ git init --bare --shared=group
    • Let’s put some code in!$ echo "some code" > index.php$ git add index.php
    • Let’s put some code in!$ echo "some code" > index.php$ git add index.phpOh shit, it is only added to the “index“!
    • Let’s put some code in!$ echo "some code" > index.php$ git add index.phpOh shit, it is only added to the “index“!Well, fuck that!$ git commit -m "My first commit"
    • Let’s put some code in!$ echo "some code" > index.php$ git add index.phpOh shit, it is only added to the “index“!Well, fuck that!$ git commit -m "My first commit"But it is not on the remote server yet!$ git push ...
    • Nobody is looking, let’s commit everything!$ cat > index.php<?php Thousand lines of code...ˆD$ git commit -a
    • What the hell did I do? (in the working tree)$ git diff
    • What the hell did I do a year ago?$ git log
    • I have no idea what I do Let’s not show it to everyone (yet)!$ git branch experimental$ git checkout experimental
    • What branch am I on?$ git branch -a
    • Turns out I am smart after all$ git checkout master$ git merge experimental
    • I was smart todayLet’s show it to everyone$ git push <repository> <refspec>
    • I was smart today Let’s show it to everyone$ git push <repository> <refspec>Damn! Somebody was faster...Conflict =(
    • My code, let me show it to you!$ git clone <repository>
    • My code, let me show it to you!$ git clone <repository>Okay, I already have you repo, I want to laugh atyour code!boss$ git pull <repository>
    • Tagging$ git tag
    • Submodules
    • Submodules$ git submodule add <repository> <path>
    • Submodules$ git submodule add <repository> <path> From the root directory!
    • Ranges$ git log 0af56ffa..HEAD
    • Ranges$ git log 0af56ffa..HEAD$ git diff v2.5..HEADˆ
    • Ranges$ git log 0af56ffa..HEAD$ git diff v2.5..HEADˆ$ git cherry-pick HEAD˜4..
    • Other fun stuff◮ $ git revert◮ $ git reset◮ $ git stash◮ $ git bisect◮ $ git rebase◮ $ git gc
    • Links◮ Official git documentation◮ github◮ Git Cheat sheet