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
checkout 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 )
How commonly do programmers use Git GUIs instead of the command line ?
Use programs like SourceTree
or TortoiseGit
But, to be familiar with Git, try the command line
clone, push/pull, merge, rebase, log, tag, format-patch/am, bisect, blame, etc
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.sh
and 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 newbranch
git checkout newbranch
git branch -d newbranch
git branch
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
Github
GitLab
vs GitHub
vs othersGitLab
is an alternative to GitHub
GitLab
is free for unlimited private projects.GitHub
doesn'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