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

Introduce and download Git version control

leveton
April 11, 2012

Introduce and download Git version control

We go over the advantages of Git plus help with downloading Git onto your local machine

leveton

April 11, 2012
Tweet

More Decks by leveton

Other Decks in Programming

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! • Enter 'git –version' in the terminal 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
  9. While 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
  10. Github! • Github.com has been called Git's killer feature. It

    facilitates agile team development. • Github is used by almost every successful startup in Silicon Vally, New York, and Chicago
  11. 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 clean interface
  12. Sdsol's Github organization Everyone works on their private branch before

    committing to the master branch Everyone has access to a master branch
  13. 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
  14. 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 For example on Linux... • In the linux terminal enter.. • $ ssh-keygen -t dsa • This will generate keys that Github needs
  15. 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]
  16. Connecting your machine to Github • In Github click the

    tools button and then 'SSH Keys' on the lefthand side. tools
  17. 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