advance workshop on git

20
GIT & GITHUB Advance Workshop (An extension of Extra Bit with Git held on 21st Sep 16)

Upload: himanshu-agrawal

Post on 22-Jan-2018

560 views

Category:

Education


0 download

TRANSCRIPT

GIT & GITHUBAdvance Workshop(An extension of Extra Bit with Git held on 21st Sep 16)

Brief RecallWHAT 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.

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

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

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.

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.

Find a ProjectWe have a test repo for you to work on.Search for “gdgtestrepo” in search bar and open the repository

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.

Creating an issue

Create an Issue and tell the owner that you would like to work on the issue.

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.

Merge

The owner of the repo reviews your code and merges it if he finds it suitable for his project.

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.

Create a Branch

git checkout -b feature_x

Add Commits

Add, Edit or delete a file and commit

Open a Pull Request

Discuss and Review your Code

Deploy (Test your feature)

Merge

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

Questions Please

Your Feedback are Important to us: gdgjss.in/?p=751