1. Company
LOGO
Basics About Git & GitHub
Md. Raiful Hasan
DIVINE IT LIMITED
www.company.com
www.divineit.net
12/11/2012
2. Company
LOGO
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
www.company.com
www.divineit.net
2 12/11/2012
3. Company
LOGO
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
www.company.com
www.divineit.net
3 12/11/2012
4. Company
LOGO
Version Control
• Visual Source Safe
• CVS ( Concurrent Version System )
• SVN ( SubVersion )
• Bazaar
• Mercurial ( hg )
• Git
www.company.com
www.divineit.net
4 12/11/2012
5. Company
LOGO
Version Control
Local Version Control Centralized Version Control
www.company.com
www.divineit.net
5 12/11/2012
6. Company
LOGO
Centralized Version Control (cont…)
www.company.com
www.divineit.net
6 12/11/2012
7. Company
LOGO
Distributed Version Control
Full mirror Full mirror
www.company.com
www.divineit.net
7 12/11/2012
8. Company
LOGO
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.
www.company.com
www.divineit.net
8 12/11/2012
9. Company
LOGO
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)
www.company.com
www.divineit.net
9 12/11/2012
10. Company
LOGO
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
www.company.com
www.divineit.net
10 12/11/2012
11. Company
LOGO
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
www.company.com
www.divineit.net
11 12/11/2012
12. Company
LOGO
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
www.company.com
www.divineit.net
12 12/11/2012
13. Company
LOGO
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.
www.company.com
www.divineit.net
13 12/11/2012
14. Company
LOGO
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,
www.company.com
www.divineit.net name your milestone, then start grouping issues together.
14 12/11/2012
15. Company
LOGO
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.
www.company.com
www.divineit.net
15 12/11/2012
16. Company
LOGO
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
www.company.com notes next to the code or at the bottom of the whole commit.
www.divineit.net
16 12/11/2012
17. Company
LOGO
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.
www.company.com
www.divineit.net
17 12/11/2012
18. Company
LOGO
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
www.company.com
www.divineit.net
18 12/11/2012
19. Company
LOGO
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…
www.company.com
www.divineit.net
19 12/11/2012
20. Company
LOGO
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.
www.company.com
www.divineit.net
20 12/11/2012
21. Company
LOGO
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.
www.company.com
www.divineit.net
21 12/11/2012
22. Company
LOGO
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 ....
www.company.com
www.divineit.net
22 12/11/2012
23. Company
LOGO
Price
www.company.com
www.divineit.net
23 12/11/2012
24. Company
LOGO
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
www.company.com
www.divineit.net
24 12/11/2012
25. Company
LOGO
Thank You
www.company.com
www.divineit.net
25 12/11/2012