1. GIT & GITHUB
Advance Workshop
(An extension of Extra Bit with Git held on 21st Sep 16)
2. Brief Recall
WHAT IS GIT
● Git is a free and distributed version control and source
code management system with an emphasis on speed
and efficiency.
WHAT IS GITHUB
● Github is a web based Git repository hosting service which
offers all version control functionality of git and adds
some features of its own.
3. Basic Workflow
● Initializing a directory as Git Repo:
○ git init
● Creating a repo on github online:
○ Visit www.github.com
● Linking working directory to github repo:
○ git remote add origin http://github.com/username/reponame
● Updating local repository :
○ git pull
4. Basic Workflow
● Adding changes to staging area:
○ git add .
● Taking Backup in form of snapshots:
○ git commit -m “message”
● Publishing the commits to github
○ git push origin master
Tip: You can also clone a repo and make changes instead of using git init
git clone github_repo_url
5. Contribution to Open Source
A great way to get involved in open source is to contribute to
the existing projects based on your skills and interests. Git
Hub is home to more than 5 million open source projects of
every skill set like recipes, HTML/CSS, Ruby, Astrophysics
and many more.
6. Workflow
● Find a project.
● Go through Documentation.
● Fork and Clone the repository.
● Make necessary changes.
● Create an issue(Optional).
● Open Pull Request.
If your pull request is merged-great! If it is not, it may not be what project manager
had in mind.
7. Find a Project
We have a test repo for you to work on.
Search for “gdgtestrepo” in search bar and open the repository
8. Fork a Repo
A fork is a copy of repository. Forking other’s repository allows you to freely
experiment with changes without affecting the original project.
10. Pull Request
Create a pull request to propose and collaborate on changes to a repository.
These changes are proposed in a branch, which ensures that the master branch
only contains finished and approved work.
11. Merge
The owner of the repo reviews your code and merges it if he
finds it suitable for his project.
12. Basics of Branching
When you're working on a project, you're going to have a
bunch of different features or ideas in progress at any given
time – some of which are ready to go, and others which are
not. Branching exists to help you manage this workflow.
You're free to experiment and commit changes in branches
other than master branch safely.
19. A Website hosting platform
There is something interesting for you guys!!!
You all know basic HTML (build a simple website) but what if you get a platform to
host your site. Github provides one.
When you create a repository named username.github.io and add your html
content, Github automatically publishes your website.
Ex. microsoft.github.io