Why of version control
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Why of version control

  • 1,573 views
Uploaded on

A short introduction to version control

A short introduction to version control

More in: Software
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,573
On Slideshare
1,559
From Embeds
14
Number of Embeds
4

Actions

Shares
Downloads
13
Comments
0
Likes
0

Embeds 14

https://twitter.com 11
http://tweetedtimes.com 1
https://lti-examples.heroku.com 1
http://www.slideee.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Examples:https://github.com/lexnederbragt/sequencetoolshttps://github.com/swcarpentry/bc

Transcript

  • 1. Version control What? Why? How? Lex Nederbragt, lex.nederbragt@ibv.uio.no
  • 2. What is version control Annotated log of changes Backup system Collaboration tool For any file type, but text files work best Code!
  • 3. A definition Version control A tool for managing changes to a set of files Each set of changes creates a new revision of the files Allows users to recover old revisions reliably Helps manage conflicting changes made by different users From the Software Carpentry website
  • 4. Use case I: reviewer #3 Paper submitted After a couple of months Reviewer 3 writes: “Please generate figure 3 with a higher resolution”
  • 5. Use case I: reviewer #3 Your reply to the reviewer We have continued to work on the code that had generated the figures for the original paper, and couldn’t recreate the exact code used Our new code generates a graph which slightly alters the interpretation
  • 6. Use case I: reviewer #3 How would version control have helped? ‘Turn back the clock’ to the code used Rerun analysis Recreate exact figure
  • 7. Use case II
  • 8. Use case II From my own work: $ cd scripts $ ls blat_parse4.pl old_versions snps_flanks_2_fastq.pl $ ls old_versions/ blat_parse2.pl blat_parse_attemp1.pl blat_parse.pl.bak blat_parse.pl blat_parse3_backup.pl blat_parse3.pl
  • 9. Use case II How would version control have helped? Older versions ‘hidden’ but still accessible Annotated history of all changes available Bonus: Allows for safely trying out changes
  • 10. Annotated log of changes http://starlogs.net/#lexnederbragt/denovo-assembly-tutorial
  • 11. Use case III: collaboration Example: Wikipedia http://en.wikipedia.org/wiki/Version_control Fully traceable history of all contributions
  • 12. Use case III: collaboration Example: Google docs Fully traceable history of all contributions
  • 13. Use case IV: how you work Using version control: makes me change code in small steps makes me log (annotate) my changes makes me feel safe to change code makes it easier to try out things
  • 14. “But, this is way too complex!” merge tag checkout rebase branch pull request conflict https://www.atlassian.com/git/workflows fetch pull push diff log status
  • 15. “But, this is way too complex!” Can keep it very simple Just one piece of code, only you work on it … A few scripts in one folder, made available online A large code base with multiple contributors
  • 16. Private versus public Local, private git repo Shared, central, private git repo Shared, public git repo
  • 17. My advice Try git See http://software-carpentry.org/v5/novice/git/