bedjango talk about git & github
TRANSCRIPT
Alfonso Rodríguez @fondelsur#BeDjango
Version Control Systems (VCS) : Git
and 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
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
RoadmapNot bad! #BeDjango
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
RoadmapKeep calm! #BeDjango
RoadmapTerms
Common terms used in every VCS:
- Repository (Repo)- Module- Version- Tag- Baseline- Branch- Checkout- Commit- Merge- Freeze- Conflict- Workflow- Diff
#BeDjango
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
RoadmapGit and GitHub #BeDjango
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
RoadmapWorkshop #BeDjango
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
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
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
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
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
RoadmapUseful links
- https://git-scm.com/doc
- http://rogerdudler.github.io/git-guide/
#BeDjango
Workflow
qa ci
US X
US Y
master
@fondelsurBeDjango ch
ef
#BeDjango
Workflow
qa ci
US X
US Y
master
CI validation
CI validation
@fondelsurBeDjango ch
ef
#BeDjango
Workflow
qa ci
US X
US Y
master
@fondelsur
CI validation
CI validation
tags
BeDjango ch
ef
#BeDjango
Workflow
qa ci
US X
US Y
master
on demandQA validation
releasing
tags
tags
@fondelsur
CI validation
CI validation
BeDjango ch
ef
#BeDjango
Workflow
pull request
Code Inspection
Delivery
Testing
accept/reject
Code Style
@fondelsurBeDjango ch
ef
#BeDjango
Workflow
pull request
accept/reject
+
PyUnit
@fondelsur
PEP 8 - Code Style
BeDjango ch
ef
#BeDjango
Questions?
Questions?
@fondelsur
#BeDjango
BeDjangoSevilla - London - Zurich - Chile +34 954 51 75 77 [email protected] www.bedjango.com
Thanks!
#BeDjango