Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git tutorial 1

leveton
March 30, 2012
110

Git tutorial 1

A quick overview of the Git Version Control System including the setup

leveton

March 30, 2012
Tweet

Transcript

  1. Snapshots • Git saves memory compared to other VCS's by

    having pointers to a central repository (your project). • These pointers combined with any changes you make are called branches Project branches Branch commits Your project
  2. local • When you download a project (called cloning a

    repo), you get the entire projects history on your local machine
  3. local • See all changes without having to ping the

    server • Continue working even when you don't have internet access • Your work will only be seen when you are ready
  4. Integrity • Git stores everything with a SHA-1 hash, not

    by filename • Every file's history is a set of hashes
  5. Branching • Copying a repo (project) to work on only

    creates a pointer (branch) to the original project for a better memory profile • creating and destroying many branches throughout the day is common with git
  6. Let's get started... • Download Git 2 sources for downloading

    git • http://git-scm.com/ • http://progit.org/book/ch1-4.html • Enter 'git –version' to make sure it's installed
  7. In the terminal... $ git config --global user.name [your name]

    $ git config --global user.name [your email] • This info ensures that you get credit for you contributions to projects
  8. Github! • Github.com is Git's other killer feature (along with

    branching). It facilitates agile team development. • Github is used by every successful startup in Silicon Vally, New York, and Chicago
  9. Github • Github allows us to collaborate on projects without

    having to worry about version conflicts • Also, we can see every change to every file in our projects through a nice clean interface
  10. Sdsol's Github organization Everyone works on their own branch before

    committing to the master branch Everyone has access to a master branch
  11. Create a free Github account • Sign up at github.com

    using the same email you used for your global Git email. The free account option looks like this... • Send me your email at [email protected] so that we can give you access to our projects' repos
  12. Connecting your machine to Github • In the linux terminal

    enter.. • $ ssh-keygen -t dsa • This will generate keys that Github needs For other OS types go to help.github.com → Beginner → Set Up Git
  13. Connecting your machine to Github • Find your machines .ssh

    directory and open the id_rsa.pub file and copy the contents of this file • It should look something like... ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpMctjezc1mlK/uR0csjsBUMEI03gxWMTEo/Mrku+B mnPS9sO1r77dd9GdxatNiacgyRvqbcUlTTxPS8OTO4eemHCFdsrwS0LlZbqTOzhE8Dgvfw0dE3/s ehTfL2Mz6bS9XCa5b16fo6viZeFBninCyT/QJDrBaaaSgdgUSlcSo409UwJtuVjdY8Ez6oNs2WS4b vRCfpqY6x+SuzwiyNzEbVP8m4NECyMj5oSytDFktpGAasY8k0jSafRalllhR7Q+dSBW505ymM1jS e3BnDmLIJjvfYIDJ+kM9U41lwVVMMOoK58sKVCEvSm7+otRejPcC7YElbz4/XUTCfZxcsOBffnTlt DM/ [email protected]
  14. Connecting your machine to Github • In Github click the

    tools button and then 'SSH Keys' on the lefthand side. tools
  15. Connecting your machine to Github • Now Github will prompt

    you to enter a title and the contents of id_rsa.pub so that you can clone and push to and from their server • Please send me your Github email by the end of the day - you should get a notification on your Github page that we've added you to sdsol-tech. Tomorrow we'll walk through Sdsol's Github organization. Notifications