why of version control
DESCRIPTION
A short introduction to version controlTRANSCRIPT
![Page 2: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/2.jpg)
What is version controlAnnotated log of changes
Backup system
Collaboration tool
For any file type, but text files work best
Code!
![Page 3: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/3.jpg)
A definitionVersion 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
![Page 4: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/4.jpg)
Use case I: reviewer #3Paper submitted
After a couple of months Reviewer 3 writes:
“Please generate figure 3 with a higher resolution”
![Page 5: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/5.jpg)
Use case I: reviewer #3Your 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
![Page 6: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/6.jpg)
Use case I: reviewer #3How would version control have helped?
‘Turn back the clock’ to the code used
Rerun analysis
Recreate exact figure
![Page 7: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/7.jpg)
Use case II
![Page 8: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/8.jpg)
Use case IIFrom my own work:
$ cd scripts$ lsblat_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.plblat_parse3_backup.plblat_parse3.pl
![Page 9: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/9.jpg)
Use case IIHow would version control have helped?
Older versions ‘hidden’ but still accessible
Annotated history of all changes available
Bonus:Allows for safely trying out changes
![Page 10: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/10.jpg)
Annotated log of changes
http://starlogs.net/#lexnederbragt/denovo-assembly-tutorial
![Page 11: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/11.jpg)
Use case III: collaborationExample: Wikipedia
http://en.wikipedia.org/wiki/Version_control
Fully traceable history of all contributions
![Page 12: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/12.jpg)
Use case III: collaborationExample: Google docs
Fully traceable history of all contributions
![Page 13: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/13.jpg)
Use case IV: how you workUsing version control:
makes me change code in small stepsmakes me log (annotate) my changes
makes me feel safe to change codemakes it easier to try out things
![Page 14: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/14.jpg)
“But, this is way too complex!”
merge
tag
checkout
rebase
branch
pull request
conflict
https://www.atlassian.com/git/workflows
fetch
pull
pushdiff log
status
![Page 15: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/15.jpg)
“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
![Page 16: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/16.jpg)
Private versus public
Local, private git repo
Shared, central, private git repo
Shared, public git repo
![Page 17: Why of version control](https://reader036.vdocuments.us/reader036/viewer/2022062418/554e83beb4c905f66a8b5680/html5/thumbnails/17.jpg)
My advice
Try git
See
http://software-carpentry.org/v5/novice/git/