
think of it as a series of snapshots (commits) of your code
tracking bugs
recovering from mistakes
who, when, why
No need to send email to say "I'm working on that file" (dropbox organization)
Allow work Offline (opposite to overleaf project)
Need conflict resolution
Testing new idea (and easy way to throw them out)
Multiple version of the code
git ?git"Always remember your first collaborator is your future self, and your past self doesn't answer emails"
Christie Balhai
git workflowYour local repository consists of three areas maintained by git

git in VSCodeVisual Studio Code is one of the most popular and powerful text editors used by software engineers today
Free and available for macOS, Windows, and Linux
Linux:
wgetthe deb package thendpkg -i code*.deb
To use git in VSCode, first make sure you have git installed on your computer
keep everything by default during the install process
git in VSCode{
"terminal.integrated.profiles.windows":
{
"Git Bash":
{
"path":"C:\\Program Files\\Git\\bin\\bash.exe"
},
},
"terminal.integrated.defaultProfile.windows": "Git Bash"
}
gitcheckout a remote repository
create a local working copy of a remote repository
git clone https://gogs.elic.ucl.ac.be/TECLIM/Git_Training.git
add & commit
you can propose changes (add it to the INDEX)
git add <filename>
you can commit these changes (to the HEAD)
git commit -m "Commit message"
git versioning is a succession of snapshot of your files at key time of their development
each snapshot is called commit which is :
who created, when, info
Your changes are now in the HEAD of your local working copy.
push
to send those changes to your remote repository
git push
pull
to update your local working directory to the newest commit, to fetch and merge remote changes
git pull
git diffgit undoIn case you did something wrong (which for sure never happens )
First, configure your environment (just once)
on your laptop, on your ELIC account, etc
git config --global user.name "Your Name"
git config --global user.email "foo@bar.be"
git config --global color.ui auto
git config --global core.editor "vim"
git config --list
Now, clone https://gogs.elic.ucl.ac.be/TECLIM/Git_Training.git
Theses are very simple exercices to learn to manipulate git.
In each folder, simply run./create.shand follow the guide
git branchesit can move !
git commit
git checkout -b newbranch
git checkout newbranch
git commit
git commit
git checkout master
git commit
git commit
default branch: master
git checkout -b newbranchgit checkout newbranchgit branch -d newbranchgit branch -a
see both local and remote branches
branch allow to have short/long term parallel development
the interest of branch is that you can merge them
include in one (branch) file the modification done somewhere else
git merge bx
git branch -d bx
git commit
git & GitHub ?git is the version control system service
git runs local if you don't use GitHub
GitHub is the hosting service : website
on which you can publish (push) your git repositories and collaborate with other people
GithubGitLab vs GitHub vs othersGitLab is an alternative to GitHub
GitLabis free for unlimited private projects.GitHubdoesn't provide private projects for free
And for ELIC, Gogs does the job: https://gogs.elic.ucl.ac.be/
dashboard, file browser, issue tracking, groups support, webhooks, etc
git good for ?Backup, reproducibility

Backup, reproducibility, collaboration

git conflict Do not try to avoid them at all cost !
Backup, reproducibility, collaboration, transparency

git more complicated but the standard Notes for presenter.
Discussion sur l'intΓ©rΓͺt du versioning
```mermaid pie "Git" : 73 "Mercurial" : 1 "Subversion (SVN)" : 22 "Bazaar" : 0 "CVS" : 1 ```
Notes for presenter.
Explications
Notes for presenter.
Les goΓ»ts et les couleurs
Notes for presenter.
Analogie Γ SVN
Notes for presenter.
Explications
Notes for presenter.
"clone" = clone + checkout pull = fetch + merge