or: how i learned to stopy worrying and love source control · 7 repository full history and files...

39
Git & Github or: how I learned to stopy worrying and love source control Jan Nonnen

Upload: others

Post on 07-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

Git & Github or: how I learned to stopy worrying and love source control

Jan Nonnen

Page 2: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

3

Allow rewinding changes

Easier to collaborate

See when something changed

Why use version control?

Page 3: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

4

Torvalds - Replacement of BitKeeper for Kernel dev

Design Goals:

Distributed workflow

Protection again data corruption

Performance

History

Page 4: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

5

No central server necessary

Every copy contains full history

Every repository (copy) is equal

Most operations don‘t require network

Distributed?

Page 5: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

Terminology

Page 6: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

7

Repository full history and files (.git)

Working directory visible files outside .git

Commit snapshot of project

Index staging area for next commit

Terminology

Page 7: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

8

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 8: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

9

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 9: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

10

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 10: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

11

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 11: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

12

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 12: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

13

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 13: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

14

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 14: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

15

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 15: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

16

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 16: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

17

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 17: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

18

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 18: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

19

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 19: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

20

Remote repository

Local repository

Index

Working directory

clone

commit

add

push fetch

checkout

pull

Page 20: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

21

Blob binary data

Tree folder entries of blobs

Commit snapshot of a tree

Tag fixed pointer to a commit

Branch pointer to a commit

Objects in Detail

Page 21: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

22

Points to a tree and to ancestors

0 ancestors initial commit

>1 ancestors merge commit

„name“ is 40 digit SHA-1 hash

Commit

Page 22: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

23

HEAD

master

time

Page 23: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

24

HEAD

master

time

Page 24: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

25

HEAD

master

time

Page 25: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

26

HEAD

master

time

Page 26: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

27

master

time

HEAD

fixing_javadoc

Page 27: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

28

master

time

HEAD

fixing_javadoc

Page 28: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

29

HEAD

master

time

fixing_javadoc

Page 29: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

30

master

time

HEAD

fixing_javadoc

Page 30: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

31

HEAD

master

time

fixing_javadoc

Page 31: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

32

Long-living Branches

Feature Branches

Branching Strategies

Page 32: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

33

Feature Branches

Source: https://www.atlassian.com/git/workflows

Page 33: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

Github - Social Coding

34

Page 34: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

35

Pull requests

Issues

Forks

Github

Page 35: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

36 Pull Requests

Page 36: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

37 Issues

Page 37: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

38

http://www.syntevo.com/smartgithg/download

Git UI: SmartGit

Page 38: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

39

https://help.github.com/

http://try.github.io

http://gitimmersion.com/

http://git-scm.com/book

Resources

Page 39: or: how I learned to stopy worrying and love source control · 7 Repository full history and files (.git) Working directory visible files outside .git Commit snapshot of project Index

40

http://try.github.io

https://help.github.com/articles/set-up-git

Github Hands-on