Day 1: Concepts and individual Git workflow
September 28, 2025
selina.baldauf@fu-berlin.de @selina-b
I ❤️ questions
Did anyone have problems with the workshop preparation?
🎯 Learn simple Git workflows in theory and practice that you can immediately apply to your research projects.
Material is all online
Git checks all the boxes!
For projects with mainly text files (e.g. code, markdown files, …)
Basic idea: Take snapshots (commits) of your project over time
Git is a distributed version control system
After you installed it there are different ways to interact with the software.
Using Git from the terminal
➕ Most control
➕ A lot of help/answers online
➖ You need to use terminal 😱
A Git GUI is integrated in most (all?) IDEs, e.g. R Studio, VS Code
➕ Easy and intuitive
➕ Stay inside IDE
➖ Different for every program
Standalone Git GUI software, e.g. GitHub Desktop, Source Tree, …
➕ Easy and intuitive
➕ Use for all projects
➖ Switch programs to use Git
Tip
Have a look at the website where you find How-To guides for the other methods as well.
git init
,git add
,git commit
,git push
A cook book project to collect all my favorite recipes.
In real life this would be e.g. a data analysis project, your thesis in LaTex, a software project, …
Git detects any changes in the working directory
Staging a file means to list it for the next commit.
Staging a file means to list it for the next commit.
Commits are the snapshots of your project state
Commits are the snapshots of your project state
Changes are part of Git history and staging area is clear again
See here for more details and guidelines.
Stay in the meeting for the task.
Ask if you are stuck.
Turn down volume if you are disturbed.
Start your own cook book
Complete Task 1 “Local repo”
Use remote repos to synchronize, share and collaborate (can be public or private/for collaborators only)
Use remote repos to synchronize, share and collaborate (can be public or private/for collaborators only)
Publish your cook book on GitHub
Complete Task 2 “GitHub”
git init
: Initialize a git repository
.git
folder to your working directorygit add
: Add files to the staging area
git commit
: Take a snapshot of your current project version
git push
: Push new commits to the remote repository
git revert
,git restore
git restore <file>
git revert
to revert specific commitsUndo some changes in your cook book Complete Task 3 “Undo changes”
.gitignore
.gitignore
.gitignore
.gitignore
in working directory.gitignore
file# Ignore single files
my_notes.docx # ignore the file my_notes.docx
debug.log # ignore the file debug.log
# Ignore files with specific endings
*.html # ignore all .html files
*.pdf # ignore all .pdf files
# Ignore directories
build/ # ignore all files in subdirectory build
See here for more ignore patterns that you can use.
Ignore some files in your cook book project Complete Task 4 “Ignore files”
Questions?
git checkout
Take your work space back in time temporarily with git checkout
Selina Baldauf // Basic Git workflow