Download
source control n.
Skip this Video
Loading SlideShow in 5 Seconds..
Source Control PowerPoint Presentation
Download Presentation
Source Control

Source Control

128 Vues Download Presentation
Télécharger la présentation

Source Control

- - - - - - - - - - - - - - - - - - - - - - - - - - - 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