Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Version control

6,254 views

Published on

Introduction to version control, lecture at the "Programming for Evolutionary Biology" workshop in Leipzig 2013

Published in: Technology
  • Sex in your area is here: ♥♥♥ http://bit.ly/2F90ZZC ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Version control

  1. 1. Git & version control
  2. 2. What is version control?● A way to: – Keep a log of all the changes made to your scripts & data – Synchronize all the copies of your scripts in all your computers – Be able to go back to previous working versions
  3. 3. Version control - example● A project on which I am working on at the moment (Genotype Space)● Started working on April 2012● ~2,000 revisions
  4. 4. Version control – how does it work?● Every time I make significant changes to a script, or get new results, I save a new “revision”● Each revision is associated to a description, and a date
  5. 5. Example log
  6. 6. Advantages of version control● What was the version of my scripts when I generated the results included in the paper, 2 years ago?
  7. 7. Advantages of version control● What was the version of my scripts when I generated the results included in the paper, 2 years ago?● Ive accidentally removed a portion of my code. Can I go back?
  8. 8. Advantages of version control● What was the version of my scripts when I generated the results included in the paper, 2 years ago?● Ive accidentally removed a portion of my code. Can I go back?● Ive found a folder containing scripts and results. Are the scripts updated to the latest version?
  9. 9. Git and Version control● A popular software for version control is “git”● Used for the Linux kernel● Adopted by http://github.com, popular hosting website for open source projects
  10. 10. How to get git?● http://git-scm.com/● Linux: apt-get install git
  11. 11. How to get git?● http://git-scm.com/● Linux: apt-get install git● Windows, Mac, Linux: you can install “tortoise-hg”, an – http://tortoisehg.bitbucket.org/
  12. 12. Definition: the repository● The repository is the folder where all the scripts (and eventually results) of a project are stored
  13. 13. Example of repository: bedtools
  14. 14. Examples of repository: github
  15. 15. Example of repository: database lecture
  16. 16. How to create a repository (on your computer)● Connect to evopcompute● Create a folder● “cd” to it● Type git init
  17. 17. git init● The command git init creates a new repository in the current folder● All the files and subfolder will be included in the repo (although you will have to add them manually)
  18. 18. git clone● Alternatively, you can “clone” an existing repository● git clone <url-to-repository>
  19. 19. git add● Lets add a new file to the repository● First, lets create a file: – gedit README.txt● Now, lets tell git to track it: – git add README.txt
  20. 20. Effects of git add● The command git add tells git that you want to keep track of all the changes of that file
  21. 21. git commit● Lets save our first revision: – git commit README.txt -m “DOCS: added a readme”
  22. 22. git commit● Lets save our first revision: – git commit README.txt -m “DOCS: added a readme”● Explanation: – git commit → create a new commit – README.txt → the new commit refers only to the file README.txt – -m “....” → description of the commit
  23. 23. git log● Lets see our new commit: – git log
  24. 24. Lets modify our file: git diff● The command git diff tells you all the changes made since the last commit● Lets modify our README.txt file, and see how the changes are tracked – echo “new line after first commit” > README.txt – git diff
  25. 25. Lets make more commits– echo “new line after first commit” > README.txt– git diff– git commit -m “DOCS: added a new line”– echo “another new line after first commit” > README.txt– git commit -m “DOCS: added another new line”– git log
  26. 26. git revert● If we dont like some new changes, we can revert them: – git log – git revert <id of the revision>
  27. 27. Syncronyzing a repository with github / bitbucket● A common practice is to have multiple copies of your code, stored in different places● Github and bitbucket are two free hosting services for code● Bitbucket offers unlimited space hosting, so you can keep a backup of your code there
  28. 28. How to synchronize your repo with github● Create an account at http://github.com● Follow the instructions on setting up a ssh key – https://help.github.com/articles/set-up-git – https://help.github.com/articles/generating-ssh-key s● Create a new repository from the web interface
  29. 29. git pull & push● gt clone → download a repository from github/bitbucket, for the first time● git pull → download the latest changes from your repository (e.g. github/bitbucket), and update the code on your computer● git push → upload all the latest changes to the remote repo
  30. 30. Git pull & push – best practices● Always download the latest changes (git pull) before uploading new ones (git push)● Otherwise, you will have some version conflicts● Never force a git push
  31. 31. How to collaborate on github/bitbucket● Lets imagine we want to contribute to biopython:
  32. 32. How to collaborate on github/bitbucket● To contribute to a open source repository on github/bitbucket, we will have to: – “fork” the repository using the web interface – Make changes to our forked repository – Send a “pull request” to the original repository once ready
  33. 33. Fork repository
  34. 34. Forked Repository
  35. 35. Contributing to biopython map of repositories Official BioPython repo Fork of BioPython on your on github.com FORK account on github.com PULL REQUEST CLONE Local copy of your BioPython fork, on your computer
  36. 36. Contributing to biopython● Make your changes on your local computer, and upload them to your forked repository on github● When your changes are ready for biopython, do a “Pull request”
  37. 37. Contributing to biopython
  38. 38. Pull Request
  39. 39. Pull Request
  40. 40. Version control - resume● Version control is a good practice to keep a log of all the changes in your code● Many bioinformatics tools are developed under version control
  41. 41. Having fun with stats(my Genotype Space project)
  42. 42. Having fun with stats(my Genotype Space project) ᄎ

×