SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
Git & version control
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
Version control - example
●   A project on which I
    am working on at the
    moment (Genotype
    Space)
●   Started working on
    April 2012
●   ~2,000 revisions
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
Example log
Advantages of version control
●   What was the version of my scripts when I
    generated the results included in the paper, 2
    years ago?
Advantages of version control
●   What was the version of my scripts when I
    generated the results included in the paper, 2
    years ago?
●   I've accidentally removed a portion of my
    code. Can I go back?
Advantages of version control
●   What was the version of my scripts when I
    generated the results included in the paper, 2
    years ago?
●   I've accidentally removed a portion of my
    code. Can I go back?
●   I've found a folder containing scripts and
    results. Are the scripts updated to the latest
    version?
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
How to get git?
●   http://git-scm.com/
●   Linux: apt-get install git
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/
Definition: the repository
●   The repository is the folder where all the
    scripts (and eventually results) of a project are
    stored
Example of repository: bedtools
Examples of repository: github
Example of repository: database
            lecture
How to create a repository
           (on your computer)
●   Connect to evopcompute
●   Create a folder
●   “cd” to it
●   Type git init
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)
git clone
●   Alternatively, you can “clone” an existing
    repository
●   git clone <url-to-repository>
git add
●   Let's add a new file to the repository
●   First, let's create a file:
    –   gedit README.txt
●   Now, let's tell git to track it:
    –   git add README.txt
Effects of git add
●   The command git add tells git that you want to
    keep track of all the changes of that file
git commit
●   Let's save our first revision:
    –   git commit README.txt -m “DOCS: added a
        readme”
git commit
●   Let's 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
git log
●   Let's see our new commit:
    –   git log
Let's modify our file: git diff
●   The command git diff tells you all the changes
    made since the last commit
●   Let's modify our README.txt file, and see how
    the changes are tracked
    –   echo “new line after first commit” > README.txt
    –   git diff
Let's 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
git revert
●   If we don't like some new changes, we can
    revert them:
    –   git log
    –   git revert <id of the revision>
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
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
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
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
How to collaborate on
             github/bitbucket
●   Let's imagine we want to contribute to
    biopython:
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
Fork repository
Forked Repository
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
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”
Contributing to biopython
Pull Request
Pull Request
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
Having fun with stats
(my Genotype Space project)
Having fun with stats
(my Genotype Space project)




              ᄎ

Mais conteúdo relacionado

Mais procurados (20)

Learning git
Learning gitLearning git
Learning git
 
Github basics
Github basicsGithub basics
Github basics
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
 
Git
GitGit
Git
 
Git training
Git trainingGit training
Git training
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git training v10
Git training v10Git training v10
Git training v10
 
Micro-controllers (PIC) based Application Development
Micro-controllers (PIC) based Application DevelopmentMicro-controllers (PIC) based Application Development
Micro-controllers (PIC) based Application Development
 
GitLab for CI/CD process
GitLab for CI/CD processGitLab for CI/CD process
GitLab for CI/CD process
 

Destaque (12)

Agile bioinf
Agile bioinfAgile bioinf
Agile bioinf
 
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 2
Wagner chapter 2Wagner chapter 2
Wagner chapter 2
 
Wagner chapter 1
Wagner chapter 1Wagner chapter 1
Wagner chapter 1
 
Wagner chapter 3
Wagner chapter 3Wagner chapter 3
Wagner chapter 3
 
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...
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Protein glycosylation and its associated disorders
Protein glycosylation and its associated disordersProtein glycosylation and its associated disorders
Protein glycosylation and its associated disorders
 
Lecture 7 glycosylation in cell culture
Lecture 7 glycosylation  in cell cultureLecture 7 glycosylation  in cell culture
Lecture 7 glycosylation in cell culture
 
Histone Proteins and Genome Imprinting
Histone Proteins and Genome ImprintingHistone Proteins and Genome Imprinting
Histone Proteins and Genome Imprinting
 

Semelhante a Version control

Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfGDSCKNUST
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github SahilSonar4
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptxHitesh670643
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumAbhijitNarayan2
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone useIkuru Kanuma
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptxtapanvyas11
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 

Semelhante a Version control (20)

Git & Github
Git & GithubGit & Github
Git & Github
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
 
16 Git
16 Git16 Git
16 Git
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Hello, Git!
Hello, Git!Hello, Git!
Hello, Git!
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone use
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptx
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 

Mais de Giovanni Marco Dall'Olio (15)

Fehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal ClubFehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal Club
 
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
 
Hg version control bioinformaticians
Hg version control bioinformaticiansHg version control bioinformaticians
Hg version control bioinformaticians
 
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
 
Perl Bioinfo
Perl BioinfoPerl Bioinfo
Perl Bioinfo
 
(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008
 

Último

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Último (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Version control

  • 1. Git & version control
  • 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. 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. 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
  • 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. Advantages of version control ● What was the version of my scripts when I generated the results included in the paper, 2 years ago? ● I've accidentally removed a portion of my code. Can I go back?
  • 8. Advantages of version control ● What was the version of my scripts when I generated the results included in the paper, 2 years ago? ● I've accidentally removed a portion of my code. Can I go back? ● I've found a folder containing scripts and results. Are the scripts updated to the latest version?
  • 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. How to get git? ● http://git-scm.com/ ● Linux: apt-get install git
  • 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. Definition: the repository ● The repository is the folder where all the scripts (and eventually results) of a project are stored
  • 15. Example of repository: database lecture
  • 16. How to create a repository (on your computer) ● Connect to evopcompute ● Create a folder ● “cd” to it ● Type git init
  • 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. git clone ● Alternatively, you can “clone” an existing repository ● git clone <url-to-repository>
  • 19. git add ● Let's add a new file to the repository ● First, let's create a file: – gedit README.txt ● Now, let's tell git to track it: – git add README.txt
  • 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. git commit ● Let's save our first revision: – git commit README.txt -m “DOCS: added a readme”
  • 22. git commit ● Let's 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. git log ● Let's see our new commit: – git log
  • 24. Let's modify our file: git diff ● The command git diff tells you all the changes made since the last commit ● Let's modify our README.txt file, and see how the changes are tracked – echo “new line after first commit” > README.txt – git diff
  • 25. Let's 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. git revert ● If we don't like some new changes, we can revert them: – git log – git revert <id of the revision>
  • 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. 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. 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. 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. How to collaborate on github/bitbucket ● Let's imagine we want to contribute to biopython:
  • 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
  • 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. 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”
  • 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. Having fun with stats (my Genotype Space project)
  • 42. Having fun with stats (my Genotype Space project) ᄎ