So you want to know something about Git - Maria Lehtivaara (CSC -IT Center for Science) - Eduuni-wiki
←
→
Page content transcription
If your browser does not render page correctly, please read the page content below
So you want to know something about Git Maria Lehtivaara (CSC –IT Center for Science) 16.6.2021 CSC – Finnish expertise in ICT for research, education, culture and public administration
Aim of this presentation • Give a brief idea of how Git can be used in producing re-producable science Hopefully you will: o recognise the tools & some terms, can map these to some context othink of possible use cases o know how to learn more Disclaimers • You are not a Git guru after this 20 mins L oI’m not a Git guru -just a humble user • Git usage or git tools are not specifically maintained or supported by CSC. Except… oour manuals and training material oNEIC CodeRefinery collaboration oWe are quite friendly thou J servicedesk@csc.fi 2 10.6.2021
Hey, can you check which parameters were Reproducability: used to get these results? Could we try this Bad vs small modification? better situation • Typing commands directly on the command • Typing commands and comments to version controlled prompt files, using automated workflows • Storing files in personal computer in random • Storing files in (public/joined) repositories in cloud hierarchy • Having the softwares installed as documented • Having the softwares installed (only) in your own containers (…but computer PLEASE Sure! Let me don’t ask just check my Ummm… I HAD some me again repository, and results here on my after 5 we can re-run laptop… and I THINK this years…) the needed was the laptop where I sections in these had the softwares containers! installed… 3 7.6.2021
Git -what & why? • Version control system • Used by developers / coders, but useful to anyone who writes (code) or needs to track changes to files => : that’s basically everyone, right! Example oTracks the changes you make to files oAllows to revert to specific versions (= recovery from “oopsies”) oMakes collaboration easier (allow changes by multiple people P.S: Git was to all be merged into one source) developed by Linus “Linux” Torvalds 200 5, and it’s free J Source: https://www.nobledesktop.com/blog/what-is-git-and-why-should-you-use-it 4 8.6.2021 Bread example: https://github.com/hendricius/the-bread-code
Git, GitHub, GitLab –what’s the difference? • Git = version control • GitHub = web-based Git • GitLab = like GitHub, but: system repository hosting service oSome terminology & workflow oIn cloud, for sharing difference oOn your own computer oFree when using public repos -> oPrivate repos free? oFree good for open source o“Open core” source code o“the base” development o => many organisations host o private repos for 3 members their own GitLab only! o Data stays more locally oGraphical web user interface & o Authentication extra tools oFor example: oVery popular https://coderefinery.org/repository/ Sources: https://blog.devmountain.com/git-vs-github-whats-the-difference/ 6 10.6.2021 https://blogs.helsinki.fi/thinkopen/versionhallinta-on-valttamaton-tyokalu-tutkimukselle/
So… what is where? Normal folder Git repository Remote repository archive & reference repositories Files + revision history Files + revision history Files for everyone* for you (= team, company, everyone…) Your computer Your computer Cloud Check these: https://guides.github.com/activities/citable-code/ https://www.softwareheritage.org/save-and-reference-research-software/ 7 16.6.2021 Source: https://www.nobledesktop.com/blog/what-is-git-and-why-should-you-use-it
Do I have… options? • Yep, there are other Version Control • Yep, there are other repository hosting Systems (VCSs): services: oOr “revision control”, “source code management”… 9 7.6.2021
Some Git-terminology • Some terms you might run into ( over-simplified! ) Repository: branch pull from push to master master merge branches one commit (several changed files) conflict (overlapping changes, solve!) 10 7.6.2021 Source: https://www.nobledesktop.com/blog/what-is-git-and-why-should-you-use-it
Tools for Git • Command line (=terminal) • GitHub • Handy graphical GUIs to your own computer oGitHub Desktop, Visual Studio Code, Sourcetree, Fork… • Directly from RStudio… • Lot’s of great easy-to-approach material online! ohttps://coderefinery.org/lessons/ 11 7.6.2021
Some use cases –have you considered these? • Code development oDeveloping analysis pipeline or tool • Data analysis o”What did I do again? Did I test that already? Can you continue this phD students work?” oPublications link to Git repos containing everything needed to repeat the analysis • Writing oAnything in plain text* format: article, blog post, notes… (* Markdown, LaTeX…) • Guides, learning materials… Fee l free to use oCSC’s user guides: docs.csc.fi and develop ! oCSCs course materials: https://github.com/csc-training 12 8.6.2021
Workflow sneak peak: editing our user guide At docs.csc.fi: 15 7.6.2021
In GitHub: type type type 16 7.6.2021
Commit -> branch + pull request -> review -> accept pull request + merge 17 7.6.2021
More info –where? • CSC services: servicedesk@csc.fi • Your organisations own IT support oThey might have some system in use, like GitLab o in HY for example, version.helsinki.fi • NEIC CodeRefinery (NEIC
Some learning curve in the beginning -patience J 20 8.6.2021 https://xkcd.com/1597/
You can also read