Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5d0e14c60c
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 1985 lines (1480 sloc) 58.122 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
<!DOCTYPE html>
<!--
Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Original slides: Marcin Wichary (mwichary@google.com)
Modifications: Ernest Delgado (ernestd@google.com)
Alex Russell (slightlyoff@chromium.org)
Brad Neuberg
-->

<!-- modifications for s9 template:
removed offline manifest
removed disclaimer; it's just a prototype anyway
removed google analytics script code
removed all slides
changed default list-style from none to square
-->

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">

    <title>Version Control with Git</title>
    <link href=' http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono' rel='stylesheet' type='text/css'>
    
    <!-- <link type="text/css" href="./src/scrollbar.css" rel="stylesheet"> -->
    
    <style>
      .notes { display: none; }
      .stroke {
        -webkit-text-stroke-color: red;
        -webkit-text-stroke-width: 1px;
        -moz-text-stroke-color: red;
        -moz-text-stroke-width: 1px;
      }
      
      body {
        font: 14px "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        position: absolute;
        left: 0px; top: 0px;
      }
      
      .presentation {
        position: absolute;
        height: 100%;
        width: 100%;
        left: 0px;
        top: 0px;
        display: block;
        overflow: hidden;
        background: #778;
      }
      
      .slides {
        width: 100%;
        height: 100%;
        /*
overflow: hidden;
*/
        left: 0;
        top: 0;
        position: absolute;
        display: block;
        -webkit-transition: -webkit-transform 1s ease-in-out;
        -moz-transition: -moz-transform 1s ease-in-out;
        -o-transition: -o-transform 1s ease-in-out;
      }

      .slide {
        display: none;
        position: absolute;
        overflow: hidden;
        width: 900px;
        height: 700px;
        left: 50%;
        top: 50%;
        margin-top: -350px;
        background: -webkit-gradient(linear, left bottom, left top, from(#bbd), to(#fff));
        -webkit-transition: margin 0.25s ease-in-out;
        background-color: #eee;
        background: -moz-linear-gradient(bottom, #bbd, #fff);
        -moz-transition: margin 0.25s ease-in-out;
        -o-transition: margin 0.25s ease-in-out;
      }
      
      .slide:nth-child(even) {
        border-top-left-radius: 20px;
        -moz-border-radius-topleft: 20px;
        -webkit-border-top-left-radius: 20px;
        border-bottom-right-radius: 20px;
        -moz-border-radius-bottomright: 20px;
        -webkit-border-bottom-right-radius: 20px;
      }
      
      .slide:nth-child(odd) {
        border-top-right-radius: 20px;
        -moz-border-radius-topright: 20px;
        -webkit-border-top-right-radius: 20px;
        border-bottom-left-radius: 20px;
        -moz-border-radius-bottomleft: 20px;
        -webkit-border-bottom-left-radius: 20px;
      }

      .slide p {
        font-size: 20px;
      }

      .slide .counter {
        color: #999999;
        position: absolute;
        left: 20px;
        bottom: 20px;
        display: block;
        font-size: 12px;
      }

      .slide.title > .counter,
      .slide.segue > .counter,
      .slide.mainTitle > .counter {
        display: none;
      }

      section.intro p {
        font-size: 35px;
      }

      button {
        font-size: 20px;
      }
      
      .summary {
       font-size: 30px;
      }

      .bullets {
       font-size: 40px;
      }
      
      .slide.far-past {
        display: block;
        margin-left: -2400px;
      }
      
      .slide.past {
        display: block;
        margin-left: -1400px;
      }
      
      .slide.current {
        display: block;
        margin-left: -450px;
      }
      
      .slide.future {
        display: block;
        margin-left: 500px;
      }
      
      .slide.far-future {
        display: block;
        margin-left: 1500px;
      }

      body.three-d div.presentation {
        /*background: -webkit-gradient(radial, 50% 50%, 10, 50% 50%, 1000, from(#333), to(#000)); */
      }
      
      body.three-d div.slides {
        -webkit-transform: translateX(50px) scale(0.8) rotateY(10deg);
        -moz-transform: translateX(50px) scale(0.8) rotateY(10deg);
        -o-transform: translateX(50px) scale(0.8) rotateY(10deg);
      }
      
      
      /* Content */
      
      @font-face { font-family: 'Junction'; src: url(src/Junction02.otf); }
      @font-face { font-family: 'LeagueGothic'; src: url(src/LeagueGothic.otf); }
      
      header {
        font-family: 'Droid Sans';
        font-weight: normal;
        font-size: 50px;
        letter-spacing: -.05em;
        color: white;
        color: black;
        text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px;
        position: absolute;
        left: 30px;
        top: 25px;
        margin: 0;
        padding: 0;
      }
      
      .intro h1 {
        color: black;
        padding: 0;
        margin: 0;
        letter-spacing: -2px;
        font-size: 96px;
      }
      
      .intro h2 {
        color: black;
        padding: 0;
        margin: 0;
        margin-top: -5px;
        font-size: 40px;
        letter-spacing: -1px;
      }
      
      h1 {
        display: inline;
        font-size: 100%;
       font-weight: normal;
       padding: 0;
       margin: 0;
      }
      
      h2 {
        font-family: 'Droid Sans';
        color: black;
        font-size: 20px;
        margin-left: 20px;
        margin-top: 50px;
      }
      
      h2:first-child {
        margin-top: 0;
      }

      section {
        font-family: 'Droid Sans';
        font-size: 50px;
        color: #3f3f3f;
        text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px;
        margin-left: 30px;
        margin-right: 30px;
        margin-top: 100px;
        display: block;
        overflow: hidden;
      }

      a {
        color: inherit;
        display: inline-block;
        text-decoration: none;
        line-height: 110%;
        border-bottom: 2px solid #3f3f3f;
      }

      #wmap a {
        line-height: 100%;
        border-bottom: none;
      }
      
      section.left {
        float: left;
        width: 390px;
      }
      
      section.small {
        font-size: 24px;
      }
      
      section.small ul {
        margin: 0 0 0 15px;
        padding: 0;
      }
      
      section.small li {
        padding-bottom: 0;
      }
      
      h2 {
        padding: 0;
        margin: 15px 0 5px 0;
/* font-family: GG240;*/
      }
      
      section.center {
        line-height: 180%;
        text-align: center;
        display: table-cell;
        vertical-align: middle;
        height: 700px;
        width: 900px;
      }
      
      pre {
        text-align: left;
        font-size: 16px;
        font-family: 'Droid Sans Mono', Courier;
        padding-bottom: 10px;
        
        padding: 10px 20px;
        background: rgba(255, 0, 0, 0.05);
        border-radius: 8px;
        border: 1px solid rgba(255, 0, 0, 0.2);
      }
      .two-column {
        -webkit-column-count: 2;
        -moz-column-count: 2;
      }
      
      pre select {
        font-size: 16px;
        font-family: Monaco, Courier;
        border: 1px solid #c61800;
      }
        
      input {
        font-size: 16px;
        font-family: Helvetica;
        padding: 3px;
      }
      input[type="range"] {
        width: 100%;
      }
      
      button {
        font-family: Verdana;
      }
      
      button.large {
        font-size: 32px;
      }
        
      pre b {
        font-weight: normal;
        color: #c61800;
        text-shadow: #c61800 0 0 1px;
        /*letter-spacing: -1px;*/
      }
      pre em {
        font-weight: normal;
        font-style: normal;
        color: #18a600;
        text-shadow: #18a600 0 0 1px;
      }
      pre input[type="range"] {
        height: 6px;
        cursor: pointer;
        width: auto;
      }
      example {
        font-size: 16px;
        display: block;
        padding: 10px 20px;
        color: black;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 8px;
        margin-bottom: 10px;
        border: 1px solid rgba(0, 0, 0, 0.2);
      }
      video {
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.2);
      }
      
      .css,
      .js,
      .html,
      .key {
        font-family: 'Droid Sans';
        color: black;
        display: inline-block;
        padding: 6px 10px 3px 10px;
        font-size: 25px;
        line-height: 30px;
        text-shadow: none;
        letter-spacing: 0;
        bottom: 10px;
        position: relative;
        border-radius: 10px;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
        background: white;
        box-shadow: rgba(0, 0, 0, 0.1) 0 2px 5px;
        -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0 2px 5px;
        -moz-box-shadow: rgba(0, 0, 0, 0.1) 0 2px 5px;
      }
      
      .key { font-family: Arial; }
      
      :not(header) > .css,
      :not(header) > .js,
      :not(header) > .html,
      :not(header) > .key {
        margin: 0 5px;
        bottom: 4px;
      }
      
      .css {
        background: -webkit-gradient(linear, left top, left bottom, from(#ff4), to(#ffa));
        background-color: #ff4;
        background: -moz-linear-gradient(left top, #ff4, #ffa);
      }
      .js {
        background: -webkit-gradient(linear, left top, left bottom, from(#4f4), to(#afa));
        background-color: #4f4;
        background: -moz-linear-gradient(left top, #4f4, #afa);
      }
      .html {
        background: -webkit-gradient(linear, left top, left bottom, from(#e88), to(#fee));
        background-color: #e88;
        background: -moz-linear-gradient(left top, #e88, #fee);
      }
      
      li {
        list-style: square;
        padding: 10px 0;
      }
      
      .summary li::before, .bullets li::before {
        content: '· ';
      }
      
      info {
        display: block;
        font-size: 50%;
        text-align: center;
      }
      
    </style>
    
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
  </head><body>
    <div class="presentation">
      <div class="slides">
        <div class="slide">
          <section class="center intro">
            <p>This presentation is an HTML5 website</p>
            <p>Press <span class="key">&rarr;</span> key to advance.</p>
            <p>Zoom in/out: <span class="key">Ctrl or Command</span> + <span class="key">+/-</span></p>
          </section>
        </div>
        
                
        <div class="slide">
          <header></header>
          <section class="small">
              <!-- _S9SLIDE_ -->
<p><img src="img/main-slide.png" alt="main" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="who-am-i">Who am I?</h1></header>
          <section class="small">
              <ul>
  <li>Jeroen Budts</li>
  <li>PHP &amp; Drupal Developer</li>
  <li>At <a href="http://inuits.eu">Inuits</a> - An Open Source Consultancy Company</li>
  <li><a href="http://budts.be">http://budts.be</a></li>
  <li>Twitter: @teranex</li>
  <li>Father</li>
</ul>

<p><img src="img/lotte-git.jpg" alt="lotte-git" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="overview">Overview</h1></header>
          <section class="small">
              <ul>
  <li>Basic Git usage</li>
  <li>How Git stores it&rsquo;s stuff</li>
  <li>More advanced Git usage
(branching, merging, rebasing, remotes, &hellip;)</li>
  <li>Some cool Git tools</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="what-is-git">What is Git?</h1></header>
          <section class="small">
              <blockquote>
  <p>&ldquo;Git is a free &amp; open source, distributed version control system designed to
handle everything from small to very large projects with speed and efficiency.&rdquo; </p>
</blockquote>

<ul>
  <li>Distributed</li>
  <li>Open Source</li>
  <li>Fast</li>
  <li>Created by Linus Torvalds (Linux)</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="basic-git-usage">Basic Git Usage</h1></header>
          <section class="small">
              <p>First initialize the git repository:</p>

<pre><code>git init
</code></pre>

<p>Then add files</p>

<pre><code>git add -A
# or
git add .
# or
git add myfile.txt
git add myotherfile.rb
</code></pre>

<p>And commit the files</p>

<pre><code>git commit
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="the-index-staging-area">The Index (Staging Area)</h1></header>
          <section class="small">
              <p>The index contains the changes to will be added to your next commit. Your commit will /not/ contain the changes in your working directory. Only the changes that were added to the index!</p>

<p><img src="img/git-02.png" alt="git-02" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="the-index-staging-area-1">The Index (Staging Area)</h1></header>
          <section class="small">
              <p>If you add a file, or a part of a file, to the index, a copy is made of that file. When you commit, it is that copy which ends up in the commit.</p>

<p><strong>Important</strong>: if you make changes to the file after adding it to the index, those changes will
not end up in your commit, unless you add the file again to the index!</p>

<pre><code>`git diff`
# shows the diff of your working copy

`git diff --cached`
# show the diff of your index
</code></pre>

<p>If you modify files, you need to &lsquo;<em>stage</em>&rsquo; them again, by running <code>git add</code>. </p>

<p>If you only modified files (not added new ones) you can skip staging with:</p>

<pre><code>git commit -a
</code></pre>

<p>You can also add only parts of a modified file:</p>

<pre><code>git add -p myfile.txt
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="the-index-staging-area-2">The Index (Staging Area)</h1></header>
          <section class="small">
              <pre><code>git status # show the status of your repo
</code></pre>

<p><img src="img/git-18.png" alt="git-18" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="viewing-the-history">Viewing the history</h1></header>
          <section class="small">
              <pre><code>git log
</code></pre>

<p><img src="img/git-13.png" alt="git-13" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="viewing-the-history-1">Viewing the history</h1></header>
          <section class="small">
              <p><code>git log</code> has many options. The following:</p>

<pre><code>git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset \
%s %Cgreen(%cr) %C(bold blue)an&gt;%Creset' --abbrev-commit --date=relative
</code></pre>

<p>Will give you this, which gives <strong>a lot</strong> more information</p>

<p><img src="img/git-11.png" alt="git-11" /></p>

<p>Tip: add this in your global gitconfig as an alias: ~/.gitconfig</p>

<pre><code>[alias]
    l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s
    %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit --date=relative
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="undoing-changes">Undoing changes</h1></header>
          <section class="small">
              <h2 id="checkout">Checkout</h2>
<p>Checkout a single file. Notice the dashes: <code>git checkout</code> is also used in other cases, this makes it clear to Git that you are pointing to a single file.</p>

<pre><code>git checkout -- /path/to/file # restore version from index
git checkout HEAD /path/to/file # restore to latest committed version
</code></pre>

<h2 id="reset">Reset</h2>
<p>Reset your branch to a commit and all the changes in your working copy</p>

<pre><code>git reset [--hard]
</code></pre>

<h2 id="revert">Revert</h2>
<p>Write a reversed version of an existing commit. This is very useful if you have already pushed the commit</p>

<pre><code>git revert [commit-sha]
</code></pre>

<h2 id="rebase">Rebase</h2>
<p>We&rsquo;ll discuss this later</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="how-git-stores-your-data">How Git stores your data</h1></header>
          <section class="small">
              <p>Knowing how Git stores all your data will give you a better understanding of the fundamentals and Git will become a lot more predictable</p>

<p>The most important point to remember: </p>

<p><strong>Basically a Git repository is a database of objects</strong></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="how-git-stores-your-data-1">How Git stores your data</h1></header>
          <section class="small">
              <p>The most important types of objects:</p>

<ul>
  <li>blobs</li>
  <li>trees</li>
  <li>commits</li>
</ul>

<p>Let&rsquo;s study those in a bit more detail</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="blobs">Blobs</h1></header>
          <section class="small">
              <p>Git stores the <em>contents</em> of a file in a &lsquo;blob&rsquo;.</p>

<ul>
  <li>does not contain any meta data</li>
  <li>a blob never changes</li>
  <li>a hash is calculated as the blob name</li>
  <li>the hash will always be the same for the same contents</li>
</ul>

<p>some examples:</p>

<pre><code>$ git hash-object hello.txt
ce6c1fd146f65c899e6b10e46c89097c644e3229

$ git hash-object say-hi.rb
a8784b043f12b4b0c9114c55ebf33f5c9b44ce8f
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="trees">Trees</h1></header>
          <section class="small">
              <p>A tree is a like a directory</p>

<ul>
  <li>Can contain references to 1 or more blobs</li>
  <li>Can contain references to 0, 1 or more other trees</li>
  <li>Contains the meta data about the files</li>
  <li>Itself also identified by a hash</li>
</ul>

<p><img src="img/git-03_2.png" alt="git-03" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="commits">Commits</h1></header>
          <section class="small">
              <p>If you think about Git, think about commits!</p>

<ul>
  <li>Contains a reference to one tree object</li>
  <li>Contains references to one or more other commits
    <ul>
      <li>one exception: the very first commit in the repo</li>
    </ul>
  </li>
  <li>A commit usually points to it&rsquo;s parent commit</li>
  <li>In case of a merge, it can point to two or more commits (one commit for each branch which you merged together)</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="commits-1">Commits</h1></header>
          <section class="small">
              <p><img src="img/git-04.png" alt="git-04" /></p>

<p>Did I mention that you should think in terms of commits, when working with Git? </p>

<p>If you understand commits, you basically understand Git.</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-references-or-refs">Git References or &ldquo;refs&rdquo;</h1></header>
          <section class="small">
              <p>Because a commit hash is very difficult to remember and not really useful to work with, Git uses references to point to specific commits.</p>

<h2 id="head">HEAD</h2>
<p>One such reference is <strong>HEAD</strong></p>

<ul>
  <li>It points to the commit which is currently checked out into your working directory</li>
</ul>

<h2 id="master">master</h2>
<p>Another important reference is <strong>master</strong></p>

<ul>
  <li>master is the &lsquo;default&rsquo; branch in Git</li>
  <li>when working on the master branch, the master reference and the HEAD reference point to the same commit</li>
</ul>

<h2 id="special">special</h2>

<ul>
  <li><strong>HEAD^ &amp; HEAD^^</strong>: The commit before HEAD, two commits before HEAD</li>
  <li><strong>master~7</strong>: 7 commits before master reference</li>
</ul>

<p>And that brings us to&hellip;</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="branches">Branches</h1></header>
          <section class="small">
              <p>Branches in Git are basically just references to other commits</p>

<ul>
  <li>very easy to create</li>
  <li>once you get the hang of it, you will probably create branches for almost every feature you want to implement</li>
  <li>a branch has a name</li>
  <li>this name is also the reference to the most recent commit for that branch</li>
  <li>a commit can be shared by branches</li>
  <li>The point where a branch is split of from another branch, can be found by following the parents of all the commits until you find a common commit</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="branches-1">Branches</h1></header>
          <section class="small">
              <p>Creating a branch and switching to it is easy:</p>

<pre><code>git branch mywork

git checkout mywork
</code></pre>

<p>The two previous commands can be combined:</p>

<pre><code>git checkout -b mywork
</code></pre>

<p>This will create a branch and immediately check it out.</p>

<p>Once you have merged your work on a specific feature back into your master branch you can delete your feature branch:</p>

<pre><code>git branch -d mywork
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="branches-2">Branches</h1></header>
          <section class="small">
              <ul>
  <li>We are working on a branch named &lsquo;origin&rsquo;</li>
  <li>At commit C2 we decide to split off a new branch named &lsquo;mywork&rsquo;.</li>
  <li>Both branches originate from commit C2; commit C3 and C5 have the same parent</li>
</ul>

<p><img src="img/git-05.png" alt="git-05" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="merging">Merging</h1></header>
          <section class="small">
              <p>When you have been working on a (feature) branch for a while you will probably want to merge those branches back together.</p>

<pre><code># to merge the origin branch back into your mywork branch (to bring it up to date)
# checkout the target branch
git checkout mywork
# merge the branch into the current branch
git merge origin
</code></pre>

<p>Now your repository looks like this: (Notice that commit C7 has two parents)
<img src="img/git-06.png" alt="git-06" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="merging-1">Merging</h1></header>
          <section class="small">
              <p>When merging two or more branches there are two possibilities:</p>

<ul>
  <li>Merge commit</li>
  <li>Fast Forward </li>
</ul>

<h2 id="merge-commit">Merge commit</h2>
<ul>
  <li>When both branches have new commits a merge commit is created.</li>
  <li>
    <p>Git automatically proposes a commit message: </p>

    <p><code>Merge branch 'mywork' into master</code></p>
  </li>
  <li>The commit has two or more parents</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="merging-2">Merging</h1></header>
          <section class="small">
              <h2 id="fast-forward">Fast Forward</h2>

<ul>
  <li>When the target branch does not have new commits</li>
  <li>No merge commit is created</li>
  <li>In fact nothing much happens</li>
  <li>Except: The reference for the target branch is simply changed to point the same commit as the source branch</li>
  <li>This is an ideal situation and can never go wrong</li>
  <li>Obviously you are not always this lucky (→ rebasing)</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="merging-3">Merging</h1></header>
          <section class="small">
              <h2 id="fast-forward-1">Fast Forward</h2>

<p><img src="img/git-07-before.png" alt="git-07-before" /> Merge the &lsquo;mywork&rsquo; branch into origin
<img src="img/git-07-after.png" alt="git-07-after" /> The origin branch is simply fast-forwarded</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing">Rebasing</h1></header>
          <section class="small">
              <p>Instead of merging (with merge commits) you can also rebase (so you can then fast forward)</p>

<p>Some people will tell you that this is very harmful, it can break your repository and destroy the universe.<br />
This is <strong>NOT TRUE</strong>. (At least if you know what you are doing)</p>

<h2 id="so-what-is-rebasing">So what is &lsquo;rebasing&rsquo;?</h2>

<p>By rebasing your commits you can actually rewrite your history:</p>

<ul>
  <li>Edit a commit message</li>
  <li>Add missing files to a commit</li>
  <li>Reorder your commits</li>
  <li>Modify the parent of a commit</li>
  <li>Merge a few commits together into a single commit</li>
  <li>Delete commits from the history</li>
  <li>&hellip;</li>
  <li>And break your repository if you want :)</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-1">Rebasing</h1></header>
          <section class="small">
              <h2 id="how-not-to-break-your-repo">How not to break your repo?</h2>

<p>Do not rebase commits which have already been pushed to other people </p>

<p>Do not rebase commits which have already been pushed to other people </p>

<p>Do not rebase commits which have already been pushed to other people </p>

<p>(<em>I&rsquo;l explain how to push later</em>)</p>

<p>Each commit which is rebased will get a new, different, hash. People (and Git) which pull this new hash will get confused.</p>

<p>If you do rebase a commit which was already pushed, Git will refuse the new commit, unless you use the <code>--force</code> option.</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-2">Rebasing</h1></header>
          <section class="small">
              <h2 id="amending-changes">Amending changes</h2>

<ul>
  <li>The easiest and &lsquo;safest&rsquo; kind of rebase </li>
  <li>Only possible for the most recent commit</li>
  <li>Let&rsquo;s you add missing files and modify the commit message </li>
</ul>

<p>After modifying your index again:</p>

<pre><code>git commit --amend
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-3">Rebasing</h1></header>
          <section class="small">
              <h2 id="on-another-branch">&hellip; on another branch</h2>

<p>This is an alternative approach to merging, with a merge commit.</p>

<p>Let&rsquo;s reuse the example:</p>

<p><img src="img/git-05.png" alt="git-05" /></p>

<p>Now you want to merge &lsquo;mywork&rsquo; into &lsquo;origin&rsquo; without creating a merge commit</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-4">Rebasing</h1></header>
          <section class="small">
              <h2 id="on-another-branch-1">&hellip; on another branch</h2>

<p>What we did before:</p>

<pre><code>git checkout origin
git merge mywork
</code></pre>

<p>What we will do now:</p>

<pre><code># on the mywork branch
git rebase origin
# fix any merge conflicts
git checkout origin
git merge mywork
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-5">Rebasing</h1></header>
          <section class="small">
              <h2 id="on-another-branch-2">&hellip; on another branch</h2>

<pre><code># on the mywork branch
git rebase origin
</code></pre>

<p><img src="img/git-08.png" alt="git-08" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-6">Rebasing</h1></header>
          <section class="small">
              <h2 id="on-another-branch-3">&hellip; on another branch</h2>

<p><img src="img/git-09.png" alt="git-09" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-7">Rebasing</h1></header>
          <section class="small">
              <h2 id="on-another-branch-4">&hellip; on another branch</h2>

<p><img src="img/git-10.png" alt="git-10" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-8">Rebasing</h1></header>
          <section class="small">
              <h2 id="interactively">Interactively</h2>

<p>With interactive rebasing you can really rewrite history the way you want it to be. &hellip;And break your repository.</p>

<p>Rebase the commits since <commit-hash /></p>

<pre><code>git rebase --interactive &lt;commit-hash&gt;
</code></pre>

<p>Suppose we have the following commits</p>

<p><img src="img/git-11.png" alt="git-11" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="rebasing-9">Rebasing</h1></header>
          <section class="small">
              <h2 id="interactively-1">Interactively</h2>

<p>To rebase the most recent 3 commits:</p>

<pre><code>git rebase --interactive 4efd195
</code></pre>

<p><img src="img/git-12.png" alt="git-12" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes">Working with remotes</h1></header>
          <section class="small">
              <p>To share your work with other people you have a few options. One of these is to work with remotes</p>

<p>Easiest method to set this up is by cloning an existing repository instead of initializing your repo.</p>

<pre><code>git clone http://git.drupal.org/project/drupal.git
</code></pre>

<p><img src="img/git-14.png" alt="git-14" /></p>

<p>This will set up everything for you</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-1">Working with remotes</h1></header>
          <section class="small">
              <h2 id="manually-adding-remotes">Manually adding remotes</h2>

<p>Sometimes you will want to add a remote</p>

<ul>
  <li>Because you had already created the repository</li>
  <li>Or maybe because you want to add one or more additional remotes</li>
</ul>

<p>This is done with the <code>git remote</code> command</p>

<pre><code>git remote add github git@github.com:teranex/git-talk.git
</code></pre>

<p>This will add my Github repository for this presentation as a remote with the name <em>github</em></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-2">Working with remotes</h1></header>
          <section class="small">
              <h2 id="pulling-and-pushing">Pulling and pushing</h2>

<p>When you have cloned the repository:</p>

<pre><code>git pull
</code></pre>

<p>This will pull in the changes from the current branch on the origin</p>

<pre><code>git push
</code></pre>

<p>Will push your changes to the origin</p>

<p><strong>However</strong>: This will only work for &lsquo;<em>tracking</em>&rsquo; branches.</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-3">Working with remotes</h1></header>
          <section class="small">
              <h2 id="remote-branches">Remote Branches</h2>

<p>It is important to think about remote branches as just <em>branches</em></p>

<p>By default, Git does not know, nor care, about relationships between branches!</p>

<ul>
  <li>local branch: <strong>master</strong></li>
  <li>remote (&lsquo;github&rsquo;) branch: <strong>github/master</strong></li>
  <li>
    <p><strong>Git just sees two branches</strong> </p>

    <p><code>git pull github master</code><br />
  <code>git push github master</code></p>
  </li>
  <li>By default, no local branches are created for remote branches</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-4">Working with remotes</h1></header>
          <section class="small">
              <h2 id="remote-branches-1">Remote Branches</h2>

<p>You can get a good overview of all your local and remote branches and how they are trakcing with:
    git branch -avv</p>

<p><img src="img/git-19.png" alt="img-19" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-5">Working with remotes</h1></header>
          <section class="small">
              <h2 id="tracking-branches">Tracking branches</h2>

<p>To create a local branch based on a remote branch:</p>

<pre><code>git checkout --track -b mywork github/mywork
</code></pre>

<p>To link an existing local branch to a remote branch:</p>

<pre><code>git branch --setup-stream github/mywork
</code></pre>

<p>You can verify this in the git config file (.git/config) in your repository:</p>

<p><img src="img/git-15.png" alt="git-15" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-6">Working with remotes</h1></header>
          <section class="small">
              <h2 id="merging-while-pulling">Merging while pulling</h2>

<p>To better understand pulling, let&rsquo;s see what actually happens. Instead of using <code>git pull</code>, you also do (while on the master branch):</p>

<pre><code># pull in the new objects
git fetch github

# merge the remote branch with the local branch
git merge github/master
</code></pre>

<p>This works exactly the same as merging two local branches! </p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-remotes-7">Working with remotes</h1></header>
          <section class="small">
              <h2 id="avoiding-useless-merge-commits">Avoiding useless merge commits</h2>

<p>Merging a remote branch in your local branch can create a useless merge commit:</p>

<p><img src="img/git-16.png" alt="git-16" /></p>

<p>You can avoid this by rebasing instead of merging:</p>

<pre><code>git pull --rebase
</code></pre>

<p>or, if you want to do it manually:</p>

<pre><code>git fetch github
git rebase github/master
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="some-really-cool-tools">Some really cool tools</h1></header>
          <section class="small">
              <ul>
  <li>Gitk: Part of the official Git distro, but it&rsquo;s UGLY UGLY UGLY</li>
  <li>Giggle &amp; GitX: better looking, for Gnome &amp; Mac</li>
</ul>

<p><img src="img/git-17.png" alt="git-17" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="some-really-cool-tools-1">Some really cool tools</h1></header>
          <section class="small">
              <ul>
  <li>Fugitive and gitv plugins for Vim
<img src="./img/tools-2.png" alt="tools-2" /></li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="some-really-cool-tools-2">Some really cool tools</h1></header>
          <section class="small">
              <ul>
  <li>tig: commandline. Also very useful to stage/unstage files</li>
  <li>meld: mergetool for linux, has support for git</li>
  <li>bash prompt information<br />
Include <code>$(__git_ps1 ' %s ')</code> in your $PS1
<img src="./img/tools-3.png" alt="tools-3" /></li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-and-subversion-and-friends">Git and Subversion (and friends)</h1></header>
          <section class="small">
              <p>Git has plugins available to migrate from and/or integrate into other versioning systems as well. One such plugin is <strong>git-svn</strong>.</p>

<p>With git-svn you can:</p>

<ul>
  <li>migrate an existing subversion repository to a git repository, including all the history.</li>
  <li>use Git locally to do your work, but push to a central Subversion server.</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-and-subversion">Git and Subversion</h1></header>
          <section class="small">
              <p>To locally use Git and push to a central Subversion server:</p>

<p>First &lsquo;clone&rsquo; the Subversion repository into a local Git repo</p>

<pre><code>git svn clone -s http://svn.example.com/myproject
# the -s means the subversion repo has a standard layout (trunk/ etc)
</code></pre>

<p>Now you can work as usual with your Git repository. Except&hellip; instead of running <code>git pull</code> to get the changes from other people, you now do:</p>

<pre><code>git svn rebase
</code></pre>

<p>And you don&rsquo;t do <code>git push</code>, but:</p>

<pre><code>git svn dcommit
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-flow">Git Flow</h1></header>
          <section class="small">
              <p><img src="img/git-20.png" alt="git-20" /></p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-flow-1">Git Flow</h1></header>
          <section class="small">
              <p>To use the &lsquo;<a href="https://github.com/nvie/gitflow">Git Flow</a>&rsquo; branching strategy a Git plugin is available: git-flow. This plugin makes it really easy to follow Git Flow:</p>

<p>First initialize it to configure the names. (I recommend to use the default)
    git flow init</p>

<p>To start a feature branch:</p>

<pre><code>git flow feature start my-exiting-feature
</code></pre>

<p>To publish the feature (push it to the remote)</p>

<pre><code>git flow feature publish my-exiting-feature
</code></pre>

<p>To finalize the branch:</p>

<pre><code>git flow feature finish my-exiting-feature
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-submodules">Working with submodules</h1></header>
          <section class="small">
              <p>In a Git repository you can &lsquo;link&rsquo; other repositories to subdirectories. This can be useful, for example when using external libraries or when building your VIM configuration, to pull in all the plugins.</p>

<p>But submodules do not really work the way you would expect them to work, at first:</p>

<ul>
  <li>submodules must be registered in the repository</li>
  <li>submodules must be pulled-in separately for each repo.</li>
  <li>submodules are not updated automatically</li>
  <li>submodules are not pushed automatically</li>
  <li>a specific commit is referenced in the parent repo</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="working-with-submodules-1">Working with submodules</h1></header>
          <section class="small">
              <p>First you need to add a repository as a submodule</p>

<pre><code>git submodule add git://path/to/repo path/in/repo
</code></pre>

<p>This will modify the .gitmodules file, which is part of the parent repository, and record the exact commit which is checked out in the submodule.
Now you can commit, push, etc.</p>

<p>When another repository pulls in the change the following steps are required:</p>

<pre><code>git submodule init
# This will update the .git/config file for that repository
# and register the submodule in the repository

git submodule update
# This will check-out all the submodules to the correct commit
</code></pre>

<p>To update you can checkout another commit in the submodule (for example by pulling) and commit the reference to this new commit in the parent repository.</p>

<p>To update all the modules, you can use something like:</p>

<pre><code>git submodule foreach git pull origin master
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-bisect">Git Bisect</h1></header>
          <section class="small">
              <p>Sometimes somebody will introduce bugs into your software or brake previously working features. Who knows, maybe even you! While trying to find the source of the problem, it can be useful to know which commit exactly introduced the troubles in paradise. That is exactly what Git bisect is for.</p>

<ul>
  <li>Inform Git about one &lsquo;good&rsquo; commit</li>
  <li>And about one &lsquo;bad&rsquo; commit</li>
  <li>Git will checkout a commit for you</li>
  <li>Verify that commit</li>
  <li>Tell Git whether that commit has the problem (&lsquo;bad&rsquo;), or not (&lsquo;good&rsquo;)</li>
  <li>Finally the &lsquo;bad&rsquo; commit will be found</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-bisect-1">Git Bisect</h1></header>
          <section class="small">
              <p>Let&rsquo;s say you know the feature was already broken in the previous commit and 10 commits ago the feature still worked.</p>

<p>Start Git Bisect and inform Git about this:</p>

<pre><code>git bisect start
git bisect bad HEAD^
git bisect good HEAD~10
</code></pre>

<p>Git will checkout the commit in the middle, so you can test:</p>

<pre><code>Bisecting: 5 revisions left to test after this (roughly 3 steps)
</code></pre>

<p>After testing you inform Git about the result</p>

<pre><code>git bisect good # when the feature worked
git bisect bad # when the feature is b0rken
</code></pre>

<p>After you have found the bad commit, reset your repository:</p>

<pre><code>git bisect reset
</code></pre>

<p>If you write a script which can verify each commit, you can let Git run it for every commit!</p>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="git-stash">Git Stash</h1></header>
          <section class="small">
              <p>Sometimes you will want to reset your working copy to a clean state, without committing your work, nor deleting it. In this case you can stash your changes:</p>

<pre><code>git stash
git stash save "something fancy i was working on"
</code></pre>

<p>This will create something like a commit and hard-reset your working copy.</p>

<p>Later you can retrieve your work:</p>

<pre><code>git stash list # list all your stashes
git stash pop # re-apply the latest stash, this will also delete the stash!
git stash apply # like pop, but do not delete the stash
</code></pre>

<p>I often use the stash when I want to <code>git pull --rebase</code>, while I have uncommitted changes (git will refuse to do it in that case):</p>

<pre><code>git stash
git pull --rebase
git stash pop
</code></pre>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="suggested-reading-and-resources">Suggested reading and resources</h1></header>
          <section class="small">
              <ul>
  <li>Drupal Git documentation: <a href="http://drupal.org/documentation/git">http://drupal.org/documentation/git</a></li>
  <li>the git man-pages</li>
  <li>the .git-folder of a repository (just take a look, it&rsquo;s interesting)</li>
  <li>Pro Git: <a href="http://progit.org/">http://progit.org/</a></li>
  <li>The Git Community Book: <a href="http://book.git-scm.com/">http://book.git-scm.com/</a></li>
  <li>StackOverflow: <a href="http://stackoverflow.com/questions/tagged/git">http://stackoverflow.com</a> has a lot of valuable questions and answers related to Git.</li>
</ul>



          </section>
        </div>
                
        <div class="slide">
          <header><h1 id="thanks">Thanks!</h1></header>
          <section class="small">
              <p>This presentation is licensed under the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">Creative Commons Attribution-Non Commercial-Share Alike 3.0 license</a></p>

<p>This presentation is available on github: <a href="https://github.com/teranex/git-talk">https://github.com/teranex/git-talk</a></p>

<p>Sources of images and inspiration:</p>

<ul>
  <li>Pro Git: <a href="http://progit.org/">http://progit.org/</a></li>
  <li>The Git Community Book: <a href="http://book.git-scm.com/">http://book.git-scm.com/</a></li>
  <li>Webspecies (image of Git kid): <a href="http://blog.webspecies.co.uk/2011-05-23/the-new-era-of-php-frameworks.html">http://blog.webspecies.co.uk</a></li>
</ul>


          </section>
        </div>
        

      </div> <!-- slides -->
       
    </div> <!-- presentation -->
    
    <script>
      (function() {
        // bail in IE
        var doc = document;
        if (doc.all) { return; }

        var disableBuilds = true; //true;

        var ctr = 0;
        var spaces = /\s+/, a1 = [""];

        var toArray = function(list) {
          return Array.prototype.slice.call(list||[], 0);
        };

        var byId = function(id) {
          if (typeof id == "string") { return doc.getElementById(id); }
          return id;
        };

        var query = function(query, root) {
          if (!query) { return []; }
          if (typeof query != "string") { return toArray(query); }
          if (typeof root == "string"){
            root = byId(root);
            if(!root){ return []; }
          }

          root = root||document;
          var rootIsDoc = (root.nodeType == 9);
          var doc = rootIsDoc ? root : (root.ownerDocument||document);

          // rewrite the query to be ID rooted
          if (!rootIsDoc || (">~+".indexOf(query.charAt(0)) >= 0)) {
            root.id = root.id||("qUnique"+(ctr++));
            query = "#"+root.id+" "+query;
          }
          // don't choke on something like ".yada.yada >"
          if (">~+".indexOf(query.slice(-1)) >= 0) { query += " *"; }

          return toArray(doc.querySelectorAll(query));
        };

        var strToArray = function(s) {
          if (typeof s == "string" || s instanceof String) {
            if (s.indexOf(" ") < 0) {
              a1[0] = s;
              return a1;
            } else {
              return s.split(spaces);
            }
          }
          return s;
        };

        var trim = function(str) {
          return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        };

        var addClass = function(node, classStr) {
          classStr = strToArray(classStr);
          var cls = " " + node.className + " ";
          for (var i = 0, len = classStr.length, c; i < len; ++i) {
            c = classStr[i];
            if (c && cls.indexOf(" " + c + " ") < 0) {
              cls += c + " ";
            }
          }
          node.className = trim(cls);
        };

        var removeClass = function(node, classStr) {
          var cls;
          if (classStr !== undefined) {
            classStr = strToArray(classStr);
            cls = " " + node.className + " ";
            for (var i = 0, len = classStr.length; i < len; ++i) {
              cls = cls.replace(" " + classStr[i] + " ", " ");
            }
            cls = trim(cls);
          } else {
            cls = "";
          }
          if (node.className != cls) {
            node.className = cls;
          }
        };

        var toggleClass = function(node, classStr) {
          var cls = " " + node.className + " ";
          if (cls.indexOf(" " + trim(classStr) + " ") >= 0) {
            removeClass(node, classStr);
          } else {
            addClass(node, classStr);
          }
        };

        var ua = navigator.userAgent;
        var isFF = parseFloat(ua.split("Firefox/")[1]) || undefined;
        var isWK = parseFloat(ua.split("WebKit/")[1]) || undefined;
        var isOpera = parseFloat(ua.split("Opera/")[1]) || undefined;

        var canTransition = (function() {
          var ver = parseFloat(ua.split("Version/")[1]) || undefined;
          // test to determine if this browser can handle CSS transitions.
          var cachedCanTransition =
            (isWK || (isFF && isFF > 3.6 ) || (isOpera && ver >= 10.5));
          return function() { return cachedCanTransition; }
        })();

        //
        // Slide class
        //
        var Slide = function(node, idx) {
          this._node = node;
          if (idx >= 0) {
            this._count = idx+1;
          }
          if (this._node) {
            addClass(this._node, "slide distant-future");
          }
          this._makeCounter();
          this._makeBuildList();
        };

        Slide.prototype = {
          _node: null,
          _count: 0,
          _buildList: [],
          _visited: false,
          _currentState: "",
          _states: [ "distant-past", "far-past",
                     "past", "current", "future",
                     "far-future", "distant-future" ],
          setState: function(state) {
            if (typeof state != "string") {
              state = this._states[state];
            }
            if (state == "current" && !this._visited) {
              this._visited = true;
              this._makeBuildList();
            }
            removeClass(this._node, this._states);
            addClass(this._node, state);
            this._currentState = state;

            // delay first auto run. Really wish this were in CSS.
            /*
this._runAutos();
*/
            var _t = this;
            setTimeout(function(){ _t._runAutos(); } , 400);
          },
          _makeCounter: function() {
            if(!this._count || !this._node) { return; }
            var c = doc.createElement("span");
            c.innerHTML = this._count;
            c.className = "counter";
            this._node.appendChild(c);
          },
          _makeBuildList: function() {
            this._buildList = [];
            if (disableBuilds) { return; }
            if (this._node) {
              this._buildList = query("[data-build] > *", this._node);
            }
            this._buildList.forEach(function(el) {
              addClass(el, "to-build");
            });
          },
          _runAutos: function() {
            if (this._currentState != "current") {
              return;
            }
            // find the next auto, slice it out of the list, and run it
            var idx = -1;
            this._buildList.some(function(n, i) {
              if (n.hasAttribute("data-auto")) {
                idx = i;
                return true;
              }
              return false;
            });
            if (idx >= 0) {
              var elem = this._buildList.splice(idx, 1)[0];
              var transitionEnd = isWK ? "webkitTransitionEnd" : (isFF ? "mozTransitionEnd" : "oTransitionEnd");
              var _t = this;
              if (canTransition()) {
                var l = function(evt) {
                  elem.parentNode.removeEventListener(transitionEnd, l, false);
                  _t._runAutos();
                };
                elem.parentNode.addEventListener(transitionEnd, l, false);
                removeClass(elem, "to-build");
              } else {
                setTimeout(function() {
                  removeClass(elem, "to-build");
                  _t._runAutos();
                }, 400);
              }
            }
          },
          buildNext: function() {
            if (!this._buildList.length) {
              return false;
            }
            removeClass(this._buildList.shift(), "to-build");
            return true;
          },
        };

        //
        // SlideShow class
        //
        var SlideShow = function(slides) {
          this._slides = (slides||[]).map(function(el, idx) {
            return new Slide(el, idx);
          });

          var h = window.location.hash;
          try {
            this.current = parseInt(h.split('#slide')[1], 10);
          }catch (e) { /* squeltch */ }
          this.current = isNaN(this.current) ? 1 : this.current;
          var _t = this;
          doc.addEventListener('keydown',
              function(e) { _t.handleKeys(e); }, false);
          doc.addEventListener('mousewheel',
              function(e) { _t.handleWheel(e); }, false);
          doc.addEventListener('DOMMouseScroll',
              function(e) { _t.handleWheel(e); }, false);
          doc.addEventListener('touchstart',
              function(e) { _t.handleTouchStart(e); }, false);
          doc.addEventListener('touchend',
              function(e) { _t.handleTouchEnd(e); }, false);
          window.addEventListener('popstate',
              function(e) { _t.go(e.state); }, false);
          this._update();
        };

        SlideShow.prototype = {
          _slides: [],
          _update: function(dontPush) {
            if (history.pushState) {
              if (!dontPush) {
                history.pushState(this.current, "Slide " + this.current, "#slide" + this.current);
              }
            } else {
              window.location.hash = "slide" + this.current;
            }
            for (var x = this.current-1; x < this.current+7; x++) {
              if (this._slides[x-4]) {
                this._slides[x-4].setState(Math.max(0, x-this.current));
              }
            }
          },

          current: 0,
          next: function() {
            if (!this._slides[this.current-1].buildNext()) {
              this.current = Math.min(this.current+1, this._slides.length);
              this._update();
            }
          },
          prev: function() {
            this.current = Math.max(this.current-1, 1);
            this._update();
          },
          go: function(num) {
            if (history.pushState && this.current != num) {
              history.replaceState(this.current, "Slide " + this.current, "#slide" + this.current);
            }
            this.current = num;
            this._update(true);
          },

          _notesOn: false,
          showNotes: function() {
            var isOn = this._notesOn = !this._notesOn;
            query(".notes").forEach(function(el) {
              el.style.display = (notesOn) ? "block" : "none";
            });
          },
          switch3D: function() {
            toggleClass(document.body, "three-d");
          },
          handleWheel: function(e) {
            var delta = 0;
            if (e.wheelDelta) {
              delta = e.wheelDelta/120;
              if (isOpera) {
                delta = -delta;
              }
            } else if (e.detail) {
              delta = -e.detail/3;
            }

            if (delta > 0 ) {
              this.prev();
              return;
            }
            if (delta < 0 ) {
              this.next();
              return;
            }
          },
          handleKeys: function(e) {
            switch (e.keyCode) {
              case 37: // left arrow
                this.prev(); break;
              case 39: // right arrow
              case 32: // space
                this.next(); break;
              case 50: // 2
                this.showNotes(); break;
              case 51: // 3
                this.switch3D(); break;
            }
          },
          _touchStartX: 0,
          handleTouchStart: function(e) {
            this._touchStartX = e.touches[0].pageX;
          },
          handleTouchEnd: function(e) {
            var delta = this._touchStartX - e.changedTouches[0].pageX;
            var SWIPE_SIZE = 150;
            if (delta > SWIPE_SIZE) {
              this.next();
            } else if (delta< -SWIPE_SIZE) {
              this.prev();
            }
          },
        };

        // Initialize
        var slideshow = new SlideShow(query(".slide"));
      })();
    </script>

    <!--[if IE]>
<script
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
</script>
<script>CFInstall.check({ mode: "overlay" });</script>
<![endif]-->
    
</body>
</html>
Something went wrong with that request. Please try again.