1 / 10

Source Control

Source Control. You need it. The Plan for Today. You be able to explain what the goal of version control is You will have created an online git repository for your picassa project, and uploaded your files there. What Does Source Control Do Basically?.

crescent
Download Presentation

Source Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Source Control You need it.

  2. The Plan for Today • You be able to explain what the goal of version control is • You will have created an online git repository for your picassa project, and uploaded your files there

  3. What Does Source Control Do Basically? • Keeps track of multiple versions of your files • That’s it • But this is a *revelation* https://github.com/elasticsearch/elasticsearch/tree/master/src/main/java/org/elasticsearch

  4. Why is this important • Prevents old versions from being lost • Let’s multiple people work on the same code • You can build/compile old versions • You know who changed what when

  5. There Are Many Kinds of Source Control • CVS – the old standard, now falling out of favor • SVN (or Subversion) – like CVS, but a little easier to use; Quite popular • Git – the new hotness • Mercurial – also new “Distributed” Version Control

  6. Old “Non-Distributed” Version Control All versions of Source Code Central Server queries All commands go through the server. For example: Give me the code for version X Y Z Who changed this particular file? Insert my changes into the “latest good” version Get version

  7. New “Distributed” Version Control Parent Source Code Server Copied to Synced up every now and then Local copy of the repository Get version Official repository is copied to local repository. Then all queries/changes get made to local repository. Give me the code for version X Y Z Who changed this particular file? Insert my changes into the “latest good” version Then, once everything is good… Local repository “pushes” all changes to the parent And “pulls” new changes pushed by others

  8. We will be using git • Command line! • Please don’t use the git eclipse plugin! So many mysterious bugs…

  9. Staging/Commit/Pushed • You edit a file • git add • You’ve added all you want • git commit • git push <remote> master

  10. GIT Commands for Today • git init creates a new repository • git add <file/directory> adds a new file or directory to staging • git diff shows you changes you have not committed to staging add --cashed to see what changes are in staging • git commit -m “My message” commits your changes from staging to your local repository • git push <repo-name> <branch-name> pushes your changes from your local repository to a remote repository We haven’t discussed branches yet, so use “master” which is the main branch that is always automatically created for you

More Related