Slide 1

Slide 1 text

GIT

Slide 2

Slide 2 text

Alexandru Simonescu http://alexsimo.com @alexsimonescu http://blog.alexsimo.com - Ray Bradbury [email protected]

Slide 3

Slide 3 text

Concepts Some basic concepts. It won’t hurt, i promise.

Slide 4

Slide 4 text

work modes you don’t need to be connected to network _offline first _no need of network _synchronize only when you want and what you want

Slide 5

Slide 5 text

Subversion?

Slide 6

Slide 6 text

Stages workspace staging area repository add commit working directory index HEAD

Slide 7

Slide 7 text

workspace contains the files you are working on workspace working directory

Slide 8

Slide 8 text

staging acts like intermediary zone staging area index

Slide 9

Slide 9 text

head node in git tree that points to last commit repository HEAD

Slide 10

Slide 10 text

commit registers file snapshot in git graph git add git add --all git add *.java git commit -m “Commit message”

Slide 11

Slide 11 text

push send commits to remote repository git push origin master git push origin develop

Slide 12

Slide 12 text

branch registers file snapshot in git graph git checkout -b feature git branch -d feature git branch -v git branch -a

Slide 13

Slide 13 text

remote local repository can track more than one remote git remote git remote -v git remote add origin

Slide 14

Slide 14 text

stash registers file snapshot in git graph git stash git stash list git stash apply stash@{0}

Slide 15

Slide 15 text

pull synchronizes and merges files from remote git pull origin master

Slide 16

Slide 16 text

fetch updates your local remote- tracking branches (commits, branches and tags) git fetch origin git fetch --all

Slide 17

Slide 17 text

merge merges given branch with actual; can produce conflicts $(develop) git merge feature-oauth

Slide 18

Slide 18 text

diff useful to see differences between commits or branches git diff git diff

Slide 19

Slide 19 text

tag associates tag to commit git tag v1.0 2b343csw2ff git tag v1.0

Slide 20

Slide 20 text

log displays last commits git log gitk

Slide 21

Slide 21 text

Commit message tips

Slide 22

Slide 22 text

message structure it should be like a tweet express more in less type : subject body footer

Slide 23

Slide 23 text

choose right prefix be a good citizen motherfucker ● feat: a new feature ● fix: a bug fix ● docs: changes to documentation ● style: formatting, missing semi colons, etc; no code change ● refactor: refactoring production code ● test: adding tests, refactoring test; no production code change ● chore: updating build tasks, package manager configs, etc; no production code change

Slide 24

Slide 24 text

Workflow Daily basic workflow. You won’t need more.

Slide 25

Slide 25 text

1 work on your files 2 add edited files to staging area 3 make a commit 4 push commits to remote server (optional) 5 pull remote files 6 work on your files upstream downstream

Slide 26

Slide 26 text

Workflow Pro workflow. How cool kids play. PROFESIONAL

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Kata time

Slide 29

Slide 29 text

references stuff you should check http://udacity.github.io/git-styleguide/ http://rogerdudler.github.io/git-guide/index.es.html https://www.atlassian.com/git/ http://nvie.com/posts/a-successful-git-branching-model/

Slide 30

Slide 30 text

Thanks! Alexandru V. Simonescu [email protected]