Intro Git Advices
Using Git
Matthieu Moy
Matthieu.Moy@imag.fr
2016
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 1 / 11 >
Using Git Matthieu Moy Matthieu.Moy@imag.fr 2016 Matthieu Moy - - PowerPoint PPT Presentation
Intro Git Advices Using Git Matthieu Moy Matthieu.Moy@imag.fr 2016 Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 1 / 11 > Intro Git Advices Outline Revision Control System 1 Git: Basic Principles 2 Advices Using Git 3
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 1 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 2 / 11 >
Intro Git Advices
◮ “Oh, my disk crashed.” / “Someone has stolen my laptop!” ◮ “@#%!!, I’ve just deleted this important file!” ◮ “Oops, I introduced a bug a long time ago in my code, how can I
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 3 / 11 >
Intro Git Advices
◮ “Oh, my disk crashed.” / “Someone has stolen my laptop!” ◮ “@#%!!, I’ve just deleted this important file!” ◮ “Oops, I introduced a bug a long time ago in my code, how can I
◮ Replicate:
◮ Keep history:
◮ . . . Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 3 / 11 >
Intro Git Advices
1
2
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 4 / 11 >
Intro Git Advices
1
2
◮ Never two person work at the same time. ⇒ Doesn’t scale up!
◮ People work on the same directory (same machine, NFS, ACLs . . . )
◮ People work trying to avoid conflicts, and merge later. Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 4 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 5 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 5 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 5 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 5 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 6 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 6 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 6 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 6 / 11 >
Intro Git Advices
◮ commit = snapshot of the current state, ◮ Meta-data (user’s name, date, descriptive message,. . . ) recorded in
◮ Each user works on its own copy, ◮ User explicitly “takes” modifications from others when (s)he wants. Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 7 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 8 / 11 >
Intro Git Advices
◮ The files you work on (as usual) ◮ The history, or “repository” (in the directory .git/)
◮ git clone: get a copy of an existing repository (files + history) ◮ git commit: create a new revision in a repository ◮ git pull: get revisions from a repository ◮ git push: send revisions to a repository ◮ git add, git rm and git mv: tell Git which files should be tracked ◮ git status: know what’s going on
◮ Each team creates a shared repository, in addition to work trees Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 9 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 10 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 11 / 11 >
Intro Git Advices
Matthieu Moy (Matthieu.Moy@imag.fr) Git 2016 < 11 / 11 >