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

Git - an intro, installing, and connecting to G...

leveton
May 13, 2012
64

Git - an intro, installing, and connecting to Github

leveton

May 13, 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. Decentralized • When you download a project (called cloning a

    repo), you get the entire projects history on your local machine • So if you're on the road and don't have access to your main repository, or don't even have access to the internet, you can still commit and merge with the main repo later
  3. Decentralized – the advantages of local • See all changes

    without having to ping the server • Your work will only be seen when you are ready • Not having to rely on a network is better for places with network issues like Pakistan
  4. Integrity • Git stores everything with a SHA-1 hash, not

    by filename • Every file's history is just a set of hashes
  5. Robustness • Because of its low weight, Git allows for

    fast pushing to remote locations so backing up local work is easy.
  6. Branching • Copying a repo (project) to work on only

    creates a pointer (branch) to the original project for a lighter memory profile. • Creating, merging, and destroying many branches throughout the day is common with git.
  7. Let's get started... • Download Git... • http://code.google.com/p/msysgit/downloads/list choose the

    latest 'Full installer for official Git for Windows' • During installation you will be prompted to choose one of these three, choose the 1st one Git will convert LF to CRLF when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform projects, this is the recommended setting on Windows ("core.autocrif" is set to "true"). Git will not perform any conversion when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform project: this the recommended setting on Unix( 'core.autocrlf' is set to 'input'). Git will not perform any cnversions when checking out or commiting text files. Choosing this option is not recommended for cross-platform projects('core.autocrlf' is set to false') • Choose the 1st one! • Open a terminal and enter 'git –version' to make sure it's installed
  8. If you have trouble here are two sources for downloading

    help • http://git-scm.com/ • http://progit.org/book/ch1-4.html You can also contact me [email protected]
  9. In the terminal... Don't worry, we won't use the terminal

    any more after we set up everything on your machine – we'll be using a GUI called SmartGIt. enter these commands... $ git config --global user.name [your name] $ git config --global user.email [your email]
  10. Github! • Github.com has been called Git's killer feature. It

    facilitates agile team development. • 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 clean interface
  11. Sdsol's Github organization Everyone works on their private branch before

    committing to the master branch Everyone has access to a master branch
  12. 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
  13. Connecting your machine to Github go to help.github.com → Beginner

    → Set Up Git • Github will recognize whether you're on Windows, Mac, or Linux and give you the right page steps for setting up Github on Windows... • Check for SSH keys • Backup and remove existing SSH keys • Generate a new SSH key • Add your new key to Github
  14. Connecting your machine to Github Your computer may not produce

    a randomart image, don't worry about it for now
  15. Connecting your machine to Github • The contents of id_rsa.pub

    should look something like this... ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpMctjezc1mlK/uR0csjsBUMEI03gxWMTEo/Mrku+B mnPS9sO1r77dd9GdxatNiacgyRvqbcUlTTxPS8OTO4eemHCFdsrwS0LlZbqTOzhE8Dgvfw0dE3/s ehTfL2Mz6bS9XCa5b16fo6viZeFBninCyT/QJDrBaaaSgdgUSlcSo409UwJtuVjdY8Ez6oNs2WS4b vRCfpqY6x+SuzwiyNzEbVP8m4NECyMj5oSytDFktpGAasY8k0jSafRalllhR7Q+dSBW505ymM1jS e3BnDmLIJjvfYIDJ+kM9U41lwVVMMOoK58sKVCEvSm7+otRejPcC7YElbz4/XUTCfZxcsOBffnTlt DM/ [email protected]
  16. Connecting your machine to Github • Now back in the

    terminal run... ssh -T [email protected] • 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 go through SmartGit. Notifications