Company
LOGO
www.company.com
Md. Raiful Hasan
DIVINE IT LIMITED
www.divineit.net12/11/2012
Basics About Git & GitHub
Company
LOGO
www.company.com
Overview
• What is Git?
• Why Git?
• Version Control
• What is GitHub?
• Why GitHub?
• Who is GitHub for
• Terminology
• GitHub Feature
– Collaboration
– Git Powered Wikis
– Integrated Issue Tracking
– Code Review
• Setup Git with GitHub.
• Price
2
www.divineit.net12/11/2012
Company
LOGO
www.company.com
What is Git?
• Git is a distributed revision control and source code management (SCM)
system with an emphasis on speed.
• Git was initially designed and developed by Linus Torvalds for Linux kernel
development.
• Has a full set of basic SCM tools and many advanced features
• Is available on all major OSes with many tools for visualization
3
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Version Control
• Visual Source Safe
• CVS ( Concurrent Version System )
• SVN ( SubVersion )
• Bazaar
• Mercurial ( hg )
• Git
4
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Version Control
Local Version Control
5
Centralized Version Control
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Centralized Version Control (cont…)
6
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Distributed Version Control
7
Full mirror Full mirror
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Why Git?
• Git has several advantages over Subversion
– − Distributed nature: Flexibility
– − Access controls: Security
– − Branching: Ease of Use
– − Performance: Speed
– − Small space: Resources
• Git also has Subversion read/write access for those comfortable with svn.
8
www.divineit.net12/11/2012
Company
LOGO
www.company.com
What is GitHub?
• Web-based hosting service for projects using Git.
• Github was founded by chris wanstrath and tom preston-werner and PJ Hyett.
• Has several features including
– − Social networking
– − Pastebin
– − Wiki
– − Webpage
– − Issue tracker
– − Integration with other project services (e.g. Lighthouse, Campfire,
Basecamp)
9
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Why GitHub?
• Easy setup of central Git server allows sharing among developers.
• One stop shopping for code projects.
• Easy management of users and projects.
• Can help facilitate getting users to actually use version control.
• Will aid in collaboration between UITS staff and developers on campus
10
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Terminology
• git = The shell command to work with Git.
• repo = Repository, where the code for a given project is kept.
• commit = Verb, means push the code to the server (in Git, commit =
(commit + push).
• diff = The difference between two versions of a file
• SSH = Secure SHell – Network protocol for communication between
machines.
• RSA = Rivest, Shamir, Adleman – public-key cryptography algorithm
11
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Collaboration)
• With teams you can give your developers as much or as little power as they
need, from the ability to create projects on behalf of your organization to read-
only access on existing projects.
• Team permissions: Read-only, read-write, and admin-level access.
• create as many teams with as many members as you need. There are no
limits on teams or their members.
• Shared Administration
12
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Git Powered Wikis)
• Supported formats: Markdown, Textile, RDoc, Org Mode, Creole,
ReStructured Text (ReST), ASCIIDoc, POD and Roff.
• Since every wiki is a git repository.
• Wikis are importable and exportable by default. Just clone wiki locally and
push it up at another time — all content, images, and history stays intact.
13
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Integrated Issue Tracking)
Next Generation Issue Tracking
• Every GitHub repository comes fully loaded with a next generation issue tracker.
• Assignment, labels, and milestones help manage large projects while Gmail-style keyboard shortcuts make Issues perfect for a simple TODO list or an open source project's bug tracker.
• Only teammates and collaborators can create and view issues on private repositories. Anyone may create and view issues on public repositories.
• Pull Request integration and the ability to close or reference issues from commits help bring workflow closer to code.
Assignment, Labels, & Milestones
• GitHub Issues can be assigned to a user to make it easy to know who's working on what, or which issues you need to tackle next.
•
• Labels are another way to organize your issues and are available in a variety of exciting colors.
• Milestones are great at helping everyone work towards a goal. Set a due date, name your milestone, then start grouping issues together.
14
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Integrated Issue Tracking) (cont…)
Search with Impunity
• GitHub Issues are easy to find.
• Issue titles, descriptions, and comments are all indexed with new search engine. If someone wrote it, can find it.
• Want to get more specific? The advanced search is great at narrowing down issues by their state, who they're assigned to, and more.
Close and Reference with Commit Messages
• Issues know all about commits. By using a few simple keywords you can close an issue right from a commit message, or just leave a note on the issue.
• The syntax is basic: if you want to close issue #35, put closes #35 somewhere in your commit message then push to GitHub.
• Supported keywords: close, closes, closed, fixes, fixed .
• Anyone with write access to repository may close an issue or leave a note.
15
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Code Review)
Futuristic Code Review
• GitHub Pull Request = Code + Issue + Code Comments .
• Each Pull Request takes into account not only what would like pulled but also where intend those changes to be applied.
• From there your team can discuss the changes as a whole, individual parts, or even specific lines. Later commits addressing concerns or ideas appear as
part of the discussion.
Commit Comments
• GitHub allows teammates to have a detailed discussion about each and every commit that is pushed to project.
• Should it be included? Was it done correctly? Should something else be added? Talk about each change to code with everyone involved before releasing or incorporating .
• You can click on a checkbox at the top of any commit to toggle showing inline notes next to the code or at the bottom of the whole commit.
16
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Code Review) (cont…)
Analyze Branches
• Many people love Git because of its amazing branching and merging ability.
• This often leads to having many more branches than in most other version control systems, since they're so easy to work with.
• This can cause confusion in knowing what work is in what branch or the status of your various branches.
• GitHub addresses this problem with a unique visualization of branches in Branch Listing page.
• Here list out each of branches with a graphical representation of how ahead or behind each branch is relative to currently selected branch.
• This means anyone can quickly see which branches have been recently worked on and how many unique commits are on them.
• If I want to see exactly what the total change is, I can click on the 'Compare' button next to any branch.
17
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Code Review) (cont…)
Compare View
• With GitHub admin can easily and efficiently compare any two branches in
his project or network.
•
• It shows what work is unique to a branch with respect to another branch - that
is, if admin merge the branches together, what changes would be applied?
• The Compare View between two branches is often used by teams as a
permalink to summarize changes in emails or hooks.
• The GitHub Compare View will show a list of all the commits unique to a
branch, the sum of all the files changed across all of those commits and a
unified diff of all of those changes
18
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Code Hosting)
• GitHub keeps our public and private code available, secure, and backed up.
• Stop hoarding code on our hard drive; it takes less than a minute to push code
up to GitHub and start collaborating with others.
• It doesn’t matter if we prefer to use the command line git client, a tool like hg-
git, or a graphical application like SmartGit— Github is dedicated to helping
collaborate easily and securely.
• Github focused on making source code accessible and transparent.
Anything push to a repository is instantly viewable online.
• share it with people even if they don't use Git.
• The main page of every project is a list of the files in the project and
information about the last time it was committed.
• So anyone can instantly see what is most important about project: the code.
• GitHub renders all kinds of files: Text, Images, Fonts, Markdown, Textile,
LaTeX, POD, RDoc and many more…
19
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Code Hosting) (cont…)
File History
• Every file in repo has a simple history view. We can see each commit that
changed the file and view the file at any point in time.
Blame / Annotate
• Need to figure out who added that piece of code? Open up the blame view to
see which commits and authors last affected each line.
Edit Online
• Need to make a quick change to a file? Correct a spelling error on our mobile
phone? GitHub offer a simple editor to every file in our repository.
20
www.divineit.net12/11/2012
Company
LOGO
www.company.com
GitHub Feature(Community)
Activity Streams
• GitHub allows to watch repositories and follow users to generate activity streams.
• activity streams show everything important that’s happening with anyone or anything on GitHub.
Developer Profiles
• Every developer gets their own profile page that is automatically updated with a stream of the important things they are doing on GitHub.
Explore GitHub
• Explore is a section of GitHub site where highlight the most interesting
and popular repositories on GitHub right now.
Meet the Network Graph
• It gives us as a project maintainer an at-a-glance understanding of the activity on our source code across all developers interested in it.
21
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Setup Git with GitHub.
Download and install the latest version of Git.
Set Up Git
Here is a simple Instruction Set Up Git.
Set Up GitHub• Register and login• Ready to use ....
22
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Price
23
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Reference
• https://github.com/opendream/progit
• http://help.github.com/
• http://learn.github.com/p/intro.html
• http://gitref.org/index.html
• Get an account at https://github.iu.edu
• if we want a GUI try SmartGit http://www.syntevo.com/smartgit/index.html
24
www.divineit.net12/11/2012
Company
LOGO
www.company.com
Thank You
25
www.divineit.net12/11/2012