SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Giovanni Dall'Olio,
          IBE (UPF-CEXS)




Introduction to version control
 and hg for our bioinformatics
             group
What is hg?
●   Programmers use software to keep track of all
    the versions of the code they write. These are
    called Version Control Systems (VCS)
●   There are many software to make VCS; the
    most renown are cvs, subversion, git, hg,
    bazaar
●   Git, hg and bazaar are newer and based on an
    improved paradigm called Distributed Version
    Control System (DVCS)
How will hg be useful for us?
●   Keep versions of the scripts we create
    ●   also for the datasets, results, etc..
●   Have a common and official version of the
    pipeline and the scripts, on bitbucket.org
●   Everybody will work on his computer on his
    version of the scripts; every once in a while, he
    will merge it with the official version
Installing hg
●   Hg can run on any operating system
●   On linux, install it through your software center
    ●   sudo apt-get install mercurial
●   On other OS, go to http://mercurial.selenic.com/
    and download the installer
Initial hg configuration
●   Hg stores its configuration in a file called:
     ●   ~/.hgrc on Unix
     ●   C:Documents and Settingsyour_name.hgrc
●   Open it and write your username:

    [ui]
    username = Giovanni Dall'Olio <dalloliogm@gmail.com>
The basic operations of a VCS
●   Creating a repository
    ●   Can be equivalent to 'start keeping track of the
        version of the files in this project'
●   Adding files to the repository
    ●   Files are not tracked unless you say so
●   Committing changes
    ●   Saving a version of the actual state of the files
●   Pushing the changes and merging them with
    the standard version
Creating a repository
●   Create a new directory and create the repo
    with:
    ●   hg init
Effect of creating a new repo
●   An hidden directory (.hg) will be created
●   From now on, it will be possible to give other hg
    commands
Adding files to the repo
●   By default, no files are added to the repository
●   It means that if you create a new file in the
    directory, hg will ignore it
Creating a file
Files are not added automatically to
               the repo
●   The command:
    ●   hg log file.txt
●   should return the historial of changes of the file
    file.txt. Since it is not in the repo yet, nothing is
    shown
hg add
●   To add a file to the repository, use hg add
●   This will mean that the software should record
    all the changes on that file
Committing changes
●   The most important operation in VCS is the
    commit
●   This operation saves the status of the files
    tracked and associate it with a version
●   One commit → one version
Committing a change
●   We have added the file file.txt to the repo
●   This is a change compared to the previous
    version (where this file was not present)
    ●   So we have to record it with a commit
Our first commit
Effects of adding a file and
                committing
●   From now on, all the changes made to the file
    will be tracked
What is being 'committed'?
●   Every time you commit a new version, hg
    stores the set of changes since the previous
    version
●   Other old VCS stored a copy of all the files for
    each version
    ●   => very big disk space occupation
●   By storing only the changes, hg occupies less
    space and makes it easier to compare versions
Hg diff
●   The hg diff command will show the differences
    between the file and its last saved version
Hg log
●   Hg log will show the history of the changes in
    the repository
Hg log
The story continues..
●   The basic operations in a VCS are adding files
    to the tracking, and commit changes
●   Next week we will see how to keep a copy of
    our repository on a remote server, and how to
    collaborate with other people
●   Now I will show you some example of using a
    version control system
Example: backup
●   Imagine that for error, you remove a file or a
    directory from your project
●   With a VCS, you can revert to the previous
    version and get the files back
Example: tracking code
●   VCS have been developed to track changes in
    the code
    ●   Return to the point where you have made a mistake
        or a typo
    ●   Implementing a parallel version of the code, like
        trying a different library or approach (branching)
    ●   Remember what you have been doing, when you
        have to change code written months ago
Example: releasing a software
●   Mr. Werewolf publishes a software to predict
    when the moon will be full
●   The code gets adopted by the werewolf
    community. Papers got published using it
●   At a certain point, another werewolf discover a
    bug in the code. It will be possible to seek the
    version where the error occurred and identify all
    the versions affected
Example: tracking data
●   Version control can be applied to a dataset
●   Example: Mr Dracula wants to write a paper on
    the quality of the blood in his neighborhood.
    Every time he gets new data, he commits a
    change
Tracking everything else
●   VCS can be applied to many kinds of file
●   Usually they do not support binary files
●   OpenOffice documents can be tracked (they
    are XML)
Tracking huge files
●   Hg stores the differences between two versions
●   Storing all the 1000g will take:
    ●   Some gigabytes to store a compressed version of the
        files
    ●   Less space to store the following commits (but these
        commits will take time)
●   Maybe it is not worth to put gigabytes of data
    under version control
    ●   No solution to date
    ●   Some hg extensions for big files
How frequently should I commit?
●   Everybody has his/her own phylosophy
    ●   Some people prefer to commit every smallest
        change
    ●   Others prefer to make only a big commit every day
●   As a general rule:
    ●   The biggest the commit is, the most difficult is to
        integrate it if there are conflicts
    ●   It's up to you to decide
How to write the perfect commit
               messages
●   One or two sentences
●   Avoid generic messages
    ●   “new changes”, “fixed bugs”
●   Use tags like 'Fix', 'Add', 'Config', etc..:
    ●   “Fix: error when reading file”
    ●   “Add: new function for plotting results”
●   Cite the files changed if you think it may be
    useful:
    ●   Implemented new sorting algorithm for sorting.py

Weitere ähnliche Inhalte

Was ist angesagt?

Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseHüseyin Ergin
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Git - The Incomplete Introduction
Git - The Incomplete IntroductionGit - The Incomplete Introduction
Git - The Incomplete Introductionrschwietzke
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes DesignerSlobodan Lohja
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubGDSCIIITBbsr
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Per Henrik Lausten
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitColin Su
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
Git (Sistema Distribuido de Control de Versiones)
Git (Sistema Distribuido de Control de Versiones)Git (Sistema Distribuido de Control de Versiones)
Git (Sistema Distribuido de Control de Versiones)TAWS
 
Introducción a Git
Introducción a GitIntroducción a Git
Introducción a GitJuan Antonio
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Per Henrik Lausten
 

Was ist angesagt? (20)

Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Git - The Incomplete Introduction
Git - The Incomplete IntroductionGit - The Incomplete Introduction
Git - The Incomplete Introduction
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git hub
Git hubGit hub
Git hub
 
From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 
Intro to git
Intro to gitIntro to git
Intro to git
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git (Sistema Distribuido de Control de Versiones)
Git (Sistema Distribuido de Control de Versiones)Git (Sistema Distribuido de Control de Versiones)
Git (Sistema Distribuido de Control de Versiones)
 
Introducción a Git
Introducción a GitIntroducción a Git
Introducción a Git
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 

Andere mochten auch

Andere mochten auch (8)

Please Feed the Unicorns
Please Feed the UnicornsPlease Feed the Unicorns
Please Feed the Unicorns
 
How to use incentives actively to increase revenue
How to use incentives actively to increase revenueHow to use incentives actively to increase revenue
How to use incentives actively to increase revenue
 
Machine skills ii
Machine skills iiMachine skills ii
Machine skills ii
 
wob brand afternoon 12 - B2B 2.0
wob brand afternoon 12 - B2B 2.0wob brand afternoon 12 - B2B 2.0
wob brand afternoon 12 - B2B 2.0
 
Ehis Eds Europe May2009 Brussels Deel 1
Ehis Eds Europe May2009  Brussels   Deel 1Ehis Eds Europe May2009  Brussels   Deel 1
Ehis Eds Europe May2009 Brussels Deel 1
 
2 19-14
2 19-142 19-14
2 19-14
 
PassionBusiness Workshop - Day 1
PassionBusiness Workshop - Day 1PassionBusiness Workshop - Day 1
PassionBusiness Workshop - Day 1
 
Adam Rusbridge 2010 conf
Adam Rusbridge  2010 confAdam Rusbridge  2010 conf
Adam Rusbridge 2010 conf
 

Ähnlich wie Hg version control bioinformaticians

Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.WordCamp Harare
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone useIkuru Kanuma
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoIanDavidson56
 
Version Control - Hem Shrestha
Version Control - Hem ShresthaVersion Control - Hem Shrestha
Version Control - Hem ShresthaHem Shrestha
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptxtapanvyas11
 
introduction in version control system
introduction in version control systemintroduction in version control system
introduction in version control systemBiga Gaber
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git BasicsSreedath N S
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptxEshaan35
 

Ähnlich wie Hg version control bioinformaticians (20)

GIT
GITGIT
GIT
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone use
 
Formation git
Formation gitFormation git
Formation git
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
GDSC Git event 2023.pptx
GDSC Git event 2023.pptxGDSC Git event 2023.pptx
GDSC Git event 2023.pptx
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
 
Hacktoberfest 2022
Hacktoberfest 2022Hacktoberfest 2022
Hacktoberfest 2022
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
 
Version Control - Hem Shrestha
Version Control - Hem ShresthaVersion Control - Hem Shrestha
Version Control - Hem Shrestha
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptx
 
introduction in version control system
introduction in version control systemintroduction in version control system
introduction in version control system
 
Git&GitHub.pptx
Git&GitHub.pptxGit&GitHub.pptx
Git&GitHub.pptx
 
Git for the absolute beginners
Git for the absolute beginnersGit for the absolute beginners
Git for the absolute beginners
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
Git Training
Git TrainingGit Training
Git Training
 
Git Overview
Git OverviewGit Overview
Git Overview
 

Mehr von Giovanni Marco Dall'Olio

Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...Giovanni Marco Dall'Olio
 
The true story behind the annotation of a pathway
The true story behind the annotation of a pathwayThe true story behind the annotation of a pathway
The true story behind the annotation of a pathwayGiovanni Marco Dall'Olio
 
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific researchWeb 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific researchGiovanni Marco Dall'Olio
 

Mehr von Giovanni Marco Dall'Olio (20)

Fehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal ClubFehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal Club
 
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
 
Agile bioinf
Agile bioinfAgile bioinf
Agile bioinf
 
Linux intro 5 extra: awk
Linux intro 5 extra: awkLinux intro 5 extra: awk
Linux intro 5 extra: awk
 
Linux intro 5 extra: makefiles
Linux intro 5 extra: makefilesLinux intro 5 extra: makefiles
Linux intro 5 extra: makefiles
 
Linux intro 4 awk + makefile
Linux intro 4  awk + makefileLinux intro 4  awk + makefile
Linux intro 4 awk + makefile
 
Linux intro 3 grep + Unix piping
Linux intro 3 grep + Unix pipingLinux intro 3 grep + Unix piping
Linux intro 3 grep + Unix piping
 
Linux intro 2 basic terminal
Linux intro 2   basic terminalLinux intro 2   basic terminal
Linux intro 2 basic terminal
 
Linux intro 1 definitions
Linux intro 1  definitionsLinux intro 1  definitions
Linux intro 1 definitions
 
Wagner chapter 5
Wagner chapter 5Wagner chapter 5
Wagner chapter 5
 
Wagner chapter 4
Wagner chapter 4Wagner chapter 4
Wagner chapter 4
 
Wagner chapter 3
Wagner chapter 3Wagner chapter 3
Wagner chapter 3
 
Wagner chapter 2
Wagner chapter 2Wagner chapter 2
Wagner chapter 2
 
Wagner chapter 1
Wagner chapter 1Wagner chapter 1
Wagner chapter 1
 
The true story behind the annotation of a pathway
The true story behind the annotation of a pathwayThe true story behind the annotation of a pathway
The true story behind the annotation of a pathway
 
Plotting data with python and pylab
Plotting data with python and pylabPlotting data with python and pylab
Plotting data with python and pylab
 
Pycon
PyconPycon
Pycon
 
Makefiles Bioinfo
Makefiles BioinfoMakefiles Bioinfo
Makefiles Bioinfo
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific researchWeb 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
 

Kürzlich hochgeladen

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Hg version control bioinformaticians

  • 1. Giovanni Dall'Olio, IBE (UPF-CEXS) Introduction to version control and hg for our bioinformatics group
  • 2. What is hg? ● Programmers use software to keep track of all the versions of the code they write. These are called Version Control Systems (VCS) ● There are many software to make VCS; the most renown are cvs, subversion, git, hg, bazaar ● Git, hg and bazaar are newer and based on an improved paradigm called Distributed Version Control System (DVCS)
  • 3. How will hg be useful for us? ● Keep versions of the scripts we create ● also for the datasets, results, etc.. ● Have a common and official version of the pipeline and the scripts, on bitbucket.org ● Everybody will work on his computer on his version of the scripts; every once in a while, he will merge it with the official version
  • 4. Installing hg ● Hg can run on any operating system ● On linux, install it through your software center ● sudo apt-get install mercurial ● On other OS, go to http://mercurial.selenic.com/ and download the installer
  • 5. Initial hg configuration ● Hg stores its configuration in a file called: ● ~/.hgrc on Unix ● C:Documents and Settingsyour_name.hgrc ● Open it and write your username: [ui] username = Giovanni Dall'Olio <dalloliogm@gmail.com>
  • 6.
  • 7. The basic operations of a VCS ● Creating a repository ● Can be equivalent to 'start keeping track of the version of the files in this project' ● Adding files to the repository ● Files are not tracked unless you say so ● Committing changes ● Saving a version of the actual state of the files ● Pushing the changes and merging them with the standard version
  • 8. Creating a repository ● Create a new directory and create the repo with: ● hg init
  • 9. Effect of creating a new repo ● An hidden directory (.hg) will be created ● From now on, it will be possible to give other hg commands
  • 10. Adding files to the repo ● By default, no files are added to the repository ● It means that if you create a new file in the directory, hg will ignore it
  • 12. Files are not added automatically to the repo ● The command: ● hg log file.txt ● should return the historial of changes of the file file.txt. Since it is not in the repo yet, nothing is shown
  • 13. hg add ● To add a file to the repository, use hg add ● This will mean that the software should record all the changes on that file
  • 14. Committing changes ● The most important operation in VCS is the commit ● This operation saves the status of the files tracked and associate it with a version ● One commit → one version
  • 15. Committing a change ● We have added the file file.txt to the repo ● This is a change compared to the previous version (where this file was not present) ● So we have to record it with a commit
  • 17. Effects of adding a file and committing ● From now on, all the changes made to the file will be tracked
  • 18. What is being 'committed'? ● Every time you commit a new version, hg stores the set of changes since the previous version ● Other old VCS stored a copy of all the files for each version ● => very big disk space occupation ● By storing only the changes, hg occupies less space and makes it easier to compare versions
  • 19. Hg diff ● The hg diff command will show the differences between the file and its last saved version
  • 20. Hg log ● Hg log will show the history of the changes in the repository
  • 22. The story continues.. ● The basic operations in a VCS are adding files to the tracking, and commit changes ● Next week we will see how to keep a copy of our repository on a remote server, and how to collaborate with other people ● Now I will show you some example of using a version control system
  • 23. Example: backup ● Imagine that for error, you remove a file or a directory from your project ● With a VCS, you can revert to the previous version and get the files back
  • 24. Example: tracking code ● VCS have been developed to track changes in the code ● Return to the point where you have made a mistake or a typo ● Implementing a parallel version of the code, like trying a different library or approach (branching) ● Remember what you have been doing, when you have to change code written months ago
  • 25. Example: releasing a software ● Mr. Werewolf publishes a software to predict when the moon will be full ● The code gets adopted by the werewolf community. Papers got published using it ● At a certain point, another werewolf discover a bug in the code. It will be possible to seek the version where the error occurred and identify all the versions affected
  • 26. Example: tracking data ● Version control can be applied to a dataset ● Example: Mr Dracula wants to write a paper on the quality of the blood in his neighborhood. Every time he gets new data, he commits a change
  • 27. Tracking everything else ● VCS can be applied to many kinds of file ● Usually they do not support binary files ● OpenOffice documents can be tracked (they are XML)
  • 28. Tracking huge files ● Hg stores the differences between two versions ● Storing all the 1000g will take: ● Some gigabytes to store a compressed version of the files ● Less space to store the following commits (but these commits will take time) ● Maybe it is not worth to put gigabytes of data under version control ● No solution to date ● Some hg extensions for big files
  • 29. How frequently should I commit? ● Everybody has his/her own phylosophy ● Some people prefer to commit every smallest change ● Others prefer to make only a big commit every day ● As a general rule: ● The biggest the commit is, the most difficult is to integrate it if there are conflicts ● It's up to you to decide
  • 30. How to write the perfect commit messages ● One or two sentences ● Avoid generic messages ● “new changes”, “fixed bugs” ● Use tags like 'Fix', 'Add', 'Config', etc..: ● “Fix: error when reading file” ● “Add: new function for plotting results” ● Cite the files changed if you think it may be useful: ● Implemented new sorting algorithm for sorting.py