Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Starting with Git & GitHub

2.
Agenda
•
•
•
•
•
What’s a Version Control System?
What the heck is Git?
Some Git commands
What’s about GitHub?
Git in Action!

3.
What’s a Version Control System?
“An application that allows you to
record changes to your codebase in a
structured and controlled fashion.”

4.
Why do I need that?
•
•
•
Makes it way easier to undo errors / roll
back to earlier versions of code
Makes it way easier to share a codebase
between developers without creating
conflicts
Makes it way easier to deploy changes
from development to staging or production
environments

6.
What the heck is Git?
•
•
•
•
•
Distributed Source Control system
Open source, free (GNU GPL V2)
Originally developed by Linus Torvalds for
the development of the Linux Kernel in 2005
Focus on speed and efficiency
Quite a unique design and therefore
sometimes a bit scary and difficult to
understand

7.
What the heck is Git?
•
•
•
•
Save snapshots, no differences
Branching (lightweight & fast)
Automatic merge of files
Used on personal or very large projects, and
for all size of teams

8.
Distributed Development
•
•
•
Every Git working directory contains the
complete repository and history and full
revision tracking capabilities
You’re not dependent on a central server
and you don’t have to be online
It’s extremely fast - much faster than SVN,
CVS and other systems

21.
Git Commands
Getting and Creating projects
init
To create a git repository from an existing
directory of files
$ git init
clone
If you want to get a copy of a project, you
need to clone it
$ git clone [url]

22.
Git Commands
Basic Snapshotting
git add
You have to add file contents to your staging
area before you can commit them
$ git add index.php
git status
View the status of your files in the working
directory and staging area
$ git status

31.
What's about GitHub?
•
•
•
It’s a Git repository hosting service… but it
adds many of its own features
While Git is a command line tool, GitHub
provides a web-based graphical interface
It also provides access control and several
collaboration features, such as wikis and
basic task management tools

32.
What's about GitHub?
•
•
•
By default, all projects are public and free. In
you want a private project, then pay
You can clone any public repository, follow
projects and developers, post comments, etc
It’s becoming the Facebook’s for developers

33.
Git in Action!
Go to your computer and start playing...
1. Create a new repository on GitHub
2. Clone this repository
3. Add new files
4. Commit and push them
5. Create a new branch and merge files