RaukR 2023 • Advanced R for Bioinformatics
27-Jun-2023
![]()

In software development, version control is a class of systems responsible for managing changes to computer programs or other collections of information such that revisions have a logical and consistent organization.
https://en.wikipedia.org/wiki/Comparison_of_version-control_software
A collection of files under version control.
usethis::git_sitrep()
Git config (global)
• Name: 'Sebastian-D'
• Email: 'dilorenzo.sebastian@gmail.com'
• Global (user-level) gitignore file: <unset>
• Vaccinated: FALSE
ℹ See `?git_vaccinate` to learn more
• Default Git protocol: 'https'
• Default initial branch name: <unset>
GitHub
• Default GitHub host: 'https://github.com'
• Personal access token for 'https://github.com': '<discovered>'
• GitHub user: 'Sebastian-D'
• Token scopes: 'repo, user, workflow'
• Email(s): 'dilorenzo.sebastian@gmail.com (primary)', 'sebastian.dilorenzo@scilifelab.uu.se'
Git repo for current project
• Active usethis project: '/Users/sd/Library/CloudStorage/Box-Box/Work/NBIS_CommMan'
ℹ Active project is not a Git repo

Workflow:
git add the new or changed files.git commit the current state of repository.
Useful commands:
git status lists changes in your repository.git diff shows the difference between a file and its last commit state.git reset go to a previous commit state.usethis::use_git(), initialize git in a project that did not have git activated.
git clone, copy the github repository to a local repository.usethis::use_github()git push your local file changes to the github repository.git pull the github repositories file changes to your local repository.
Working with others workflow
1. pull changes made by others from github repo.
2. Settle eventual merge conflicts.
3. Make own changes.
4. add and commit changes.
5. Repeat 3 and 4 as necessary.
6. push changes to github, sharing them with others.
git and github are great for structured, reproducible, collaborative work.
commitoften,push/pullless often.
_
platform x86_64-pc-linux-gnu
os linux-gnu
major 4
minor 2.3
2023 • SciLifeLab • NBIS • RaukR