Bedjango talk about Git & GitHub

25
Alfonso Rodríguez @fondelsur #BeDjango Version Control Systems (VCS) : Git and GitHub

Transcript of Bedjango talk about Git & GitHub

Page 1: Bedjango talk about Git & GitHub

Alfonso Rodríguez @fondelsur#BeDjango

Version Control Systems (VCS) : Git

and GitHub

Page 2: Bedjango talk about Git & GitHub

Roadmap

1 - What is a VCS?

2 - Main tools

3 - Basic terms

4 - Git and GitHub

5 - Git Workshop

5.1 - Create a repo

5.2 - A new branch

5.3 - Linking to a remote repo

5.4 - Oh… what now?

6 - Emergya Workflow example

Main Structure #BeDjango

Page 3: Bedjango talk about Git & GitHub

Roadmap

Advantages:-We can save all the project-We can make mistakes without fear!-We can experiment freely-It makes the teamwork easier!

It MUST provide:

1 - Storage, local or remote2 - Modifications and edition3 - History (logs)

Version Control System

What is a Control Version System or VCS:

It’s how about we care about the changes in a product we’re making.

We understand as version the state the product is already.

It gives us many advantages above working alone.

#BeDjango

Page 4: Bedjango talk about Git & GitHub

RoadmapNot bad! #BeDjango

Page 5: Bedjango talk about Git & GitHub

RoadmapMain Tools

Git: Quick, small sized repositories, easier branching, is agile and distributable.

Subversion: We can extract subdirectories of repos, and it’s easier to learn.

Mercurial: It’s the least intuitive and known, the knowledge is less. It provides us with many security in the pushes and pulls.

#BeDjango

Page 6: Bedjango talk about Git & GitHub

RoadmapKeep calm! #BeDjango

Page 7: Bedjango talk about Git & GitHub

RoadmapTerms

Common terms used in every VCS:

- Repository (Repo)- Module- Version- Tag- Baseline- Branch- Checkout- Commit- Merge- Freeze- Conflict- Workflow- Diff

#BeDjango

Page 8: Bedjango talk about Git & GitHub

RoadmapWhy GIT?

-It’s distributable and GLOBAL!-It’s very fast.-The repositories are small sized for its storage.-Generating branches is easy as pie-The main work: (Work directory, Index, and HEAD)

#BeDjango

Page 9: Bedjango talk about Git & GitHub

RoadmapGit and GitHub #BeDjango

Page 10: Bedjango talk about Git & GitHub

RoadmapGit and GitHub

Normal workflow:

Repo X in GitHub that has user accesses and privileges.

User A: Branch A

User B: Branch B

User C: Branch C:

#BeDjango

Page 11: Bedjango talk about Git & GitHub

RoadmapWorkshop #BeDjango

Page 12: Bedjango talk about Git & GitHub

RoadmapGit Workshop

Create a RepoThe three main commands:

1 - git init ---> Initiate a repository within the path we are

2 - git add ---> Add the files we created/changed

3 - git commit ---> Send it to the HEAD

And it’s done!

#BeDjango

Page 13: Bedjango talk about Git & GitHub

RoadmapGit Workshop

Create a new branchFrom a local repository:

1 - git branch -v → To see every branch of the project

2 - git checkout -b name_of_the_branch → It makes a custom branch from the main branch.

3 - git branch → To check the current branch

Easy as pie!

#BeDjango

Page 14: Bedjango talk about Git & GitHub

RoadmapGit Workshop

Linking to a remote repoDon’t miss a thing! This is gonna be interesting

1 - git remote -v → This checks what remote repos we have.

2 - http://www.github.com → Create a remote repository

3 - git remote add origin https://github.com/user/repo.git

4 - git remote -v → Checking again if the remote was correct

5 - git push origin name_of_the_branch ---> Send the branch online!

#BeDjango

Page 15: Bedjango talk about Git & GitHub

RoadmapGit Workshop

Okay… so… what now?

Here are some tips and tricks to make your life in github easier:

- Remember always to update the branches.- Always have in mind the whole structure of git (the trees)- Feel free and safe to code: you can always return to a

previous state- When doubts: check the log!- Github online also checks and works- Distribute your code!

And, above all, don’t be afraid to test new things.

#BeDjango

Page 16: Bedjango talk about Git & GitHub

RoadmapTo sum up!

Summary of main commands:

- git init- git clone - git add (filename o .)- git commit -m- git push- git diff- git remote add origin <server>- git status- git log- git tag- git checkout (-b, --)- git fetch- git config- git reset

#BeDjango

Page 17: Bedjango talk about Git & GitHub

RoadmapUseful links

- https://git-scm.com/doc

- http://rogerdudler.github.io/git-guide/

#BeDjango

Page 18: Bedjango talk about Git & GitHub

Workflow

qa ci

US X

US Y

master

@fondelsurBeDjango ch

ef

#BeDjango

Page 19: Bedjango talk about Git & GitHub

Workflow

qa ci

US X

US Y

master

CI validation

CI validation

@fondelsurBeDjango ch

ef

#BeDjango

Page 20: Bedjango talk about Git & GitHub

Workflow

qa ci

US X

US Y

master

@fondelsur

CI validation

CI validation

tags

BeDjango ch

ef

#BeDjango

Page 21: Bedjango talk about Git & GitHub

Workflow

qa ci

US X

US Y

master

on demandQA validation

releasing

tags

tags

@fondelsur

CI validation

CI validation

BeDjango ch

ef

#BeDjango

Page 22: Bedjango talk about Git & GitHub

Workflow

pull request

Code Inspection

Delivery

Testing

accept/reject

Code Style

@fondelsurBeDjango ch

ef

#BeDjango

Page 23: Bedjango talk about Git & GitHub

Workflow

pull request

accept/reject

+

PyUnit

@fondelsur

PEP 8 - Code Style

BeDjango ch

ef

#BeDjango

Page 24: Bedjango talk about Git & GitHub

Questions?

Questions?

@fondelsur

#BeDjango

Page 25: Bedjango talk about Git & GitHub

BeDjangoSevilla - London - Zurich - Chile +34 954 51 75 77 [email protected] www.bedjango.com

Thanks!

#BeDjango