Slide 1

Slide 1 text

Git 201 FreeFriday @ Teipir

Slide 2

Slide 2 text

Real quick...

Slide 3

Slide 3 text

Dimitris Tsironis Front-end Engineer at BugSense, JavaScript lover || hater, Open-source & (Coffee)Script addict, Technology afficcionado

Slide 4

Slide 4 text

Previously on Free Fridays...

Slide 5

Slide 5 text

How can we work more effectively in a team?

Slide 6

Slide 6 text

Introducing Branching have multiple versions of the same project work async & simultaneously safer & more clean way to do things very “cheap” branches

Slide 7

Slide 7 text

Git This is where the Git magic is happening!

Slide 8

Slide 8 text

creating a branch $ git branch # Creates a new branch $ git checkout # Switch to new branch $ git branch # Check your local branches

Slide 9

Slide 9 text

creating a branch #2 # Creates a new branch and switches to it immediately $ git checkout -b

Slide 10

Slide 10 text

Now, you can code as hard as you can!

Slide 11

Slide 11 text

Cool story, bro! But, how can we move our code to our main branch and continue with our lives?

Slide 12

Slide 12 text

Merging Merge two branches Keep the chances you want to keep You’re in control It’s easier in Git than in other VCS

Slide 13

Slide 13 text

merging a local branch $ git checkout # Switch to destination $ git merge # Merge the specified branch $ git log # Check if everything is fine

Slide 14

Slide 14 text

Once you’ve finished... You should do some housekeeping!

Slide 15

Slide 15 text

deleting a branch # Deletes branch, but keeps commits $ git branch -d # Force deletes everything, both branch and its commits $ git branch -D # USE WISELY!!

Slide 16

Slide 16 text

The Github way How Github handles branches & merging

Slide 17

Slide 17 text

Branches on Github Nothing special here Push your branches on Github Has some awesome tools for branches

Slide 18

Slide 18 text

pushing to Github # Push branch on Github $ git push origin

Slide 19

Slide 19 text

Pull Requests A nice, Web 2.0 way to handle merges, branch and working in a team

Slide 20

Slide 20 text

Pull requests Promoting collaboration Encouraging open source contributions (fork) Discussing features & changes on the go Merge without hassle and delete the branch

Slide 21

Slide 21 text

The real power is in the details! Let’s see...

Slide 22

Slide 22 text

Pull requests: reloaded Discussion for almost everything Can be created before coding starts You have a timeline history of commits Forum-like functionality lots of integrations and extra tools

Slide 23

Slide 23 text

Extra tig (apt-get install tig, brew install tig) Github Help Git basics presentation Git documentation

Slide 24

Slide 24 text

And, as always, practice, practice, PRACTICE!

Slide 25

Slide 25 text

Thanks! @tsironakos