GITHUB IN PRACTICE
Jaime Arias
Inria Grenoble Rhône-Alpes
February 2017
* Figures in this presentation are inspired by the books listed at the end.
1
Slide 2
Slide 2 text
WHAT IS GIT?
Version control system (VCS) for tracking changes in
computer files and coordinating work on those files among
multiple people
2
Slide 3
Slide 3 text
GITHUB, GITLAB AND COMPANY
≠
Web-based git repository.
Provides access control and collaboration features (i.e., bug
tracking, wiki, task management).
3
Slide 4
Slide 4 text
IT'S TIME TO TAKE THE BULL BY THE
HORNS !
4
Slide 5
Slide 5 text
BASIC CONFIGURATION
5
Slide 6
Slide 6 text
INITIALIZATION OF AN EMPTY LOCAL REPOSITORY
6
Slide 7
Slide 7 text
ADDING CHANGES TO THE REPOSITORY
7
Slide 8
Slide 8 text
ADDING CHANGES TO THE REPOSITORY
8
Slide 9
Slide 9 text
ADDING CHANGES TO THE REPOSITORY
9
Slide 10
Slide 10 text
ADDING CHANGES TO THE REPOSITORY
10
Slide 11
Slide 11 text
ADDING CHANGES TO THE REPOSITORY
11
Slide 12
Slide 12 text
ADDING CHANGES TO THE REPOSITORY
12
Slide 13
Slide 13 text
ADDING CHANGES TO THE REPOSITORY
13
Slide 14
Slide 14 text
ADDING CHANGES TO THE REPOSITORY
14
Slide 15
Slide 15 text
SHOWING CHANGES AND HISTORY
15
Slide 16
Slide 16 text
DIFF & LOG
The diff command shows the changes that have been made to
the tracked files in the repository since the last commit.
The log command shows the commits that have been made so
far.
16
Slide 17
Slide 17 text
DIFF & LOG
17
Slide 18
Slide 18 text
BRANCHING IN GIT
18
Slide 19
Slide 19 text
BRANCHING IN GIT
19
Slide 20
Slide 20 text
BRANCHING IN GIT
20
Slide 21
Slide 21 text
BRANCHING IN GIT
21
Slide 22
Slide 22 text
BRANCHING IN GIT
22
Slide 23
Slide 23 text
INTEGRATE CHANGES
23
Slide 24
Slide 24 text
MERGING
24
Slide 25
Slide 25 text
MERGING
25
Slide 26
Slide 26 text
WHEN SOMETHING IS NOT GOING WELL ...
26
Slide 27
Slide 27 text
CONFLICT
27
Slide 28
Slide 28 text
CONFLICT
28
Slide 29
Slide 29 text
CONFLICT
29
Slide 30
Slide 30 text
CONFLICT
30
Slide 31
Slide 31 text
CONFLICT
31
Slide 32
Slide 32 text
UNDO GIT ADD
If you've just asked Git to track a new file, you can undo the
operation by running the reset command.
32
Slide 33
Slide 33 text
UNDO GIT COMMIT
33
Slide 34
Slide 34 text
UNDO GIT COMMIT
34
Slide 35
Slide 35 text
GETTING STARTED IN A TEAM
35
Slide 36
Slide 36 text
WORKING ON AN EXISTING PROJECT
36
Slide 37
Slide 37 text
WORKING ON AN EXISTING PROJECT
37
Slide 38
Slide 38 text
WORKING ON AN EXISTING PROJECT
38
Slide 39
Slide 39 text
COLLABORATION WORKFLOW
39
Slide 40
Slide 40 text
UPLOAD LOCAL CHANGES TO THE REMOTE SERVER
40
Slide 41
Slide 41 text
UPLOAD LOCAL CHANGES TO THE REMOTE SERVER
41
Slide 42
Slide 42 text
UP-TO-DATE ABOUT REMOTE CHANGES
42
Slide 43
Slide 43 text
INTEGRATE REMOTE CHANGES
43
Slide 44
Slide 44 text
PUBLISH A LOCAL BRANCH
44
Slide 45
Slide 45 text
PUBLISH A LOCAL BRANCH
45
Slide 46
Slide 46 text
TRACK A REMOTE BRANCH
46
Slide 47
Slide 47 text
ADVANCED TIPS
47
Slide 48
Slide 48 text
IGNORING FILES
For a useful starting point of files to ignore, check out
gitignore.io
48
Slide 49
Slide 49 text
FIXING UP THE MOST RECENT COMMIT
49
Slide 50
Slide 50 text
STASHING YOUR WORK
The stash command takes your uncommited changes and
saves them away for later use.
50
Slide 51
Slide 51 text
THANK YOU FOR YOUR ATTENTION !
51
Slide 52
Slide 52 text
FURTHER READING
Shaumik Daityari. Jump Start Git: Take Control of Your Code and
Assets. 2015
Emma Jane Hogbin Westby. Git for Teams: A User-Centered
Approach to Creatin Efficient Workflows in Git. 2015
Mike McQuaid. Git in Practice: Includes 66 Techniques. 2015
Git Documentation: https://git-scm.com
52