Top Banner
GIT: Why And How to Presenter: Huong Nguyen Skype: lan_huong_a3
24

Git: Why And How to

Apr 22, 2015

Download

Technology

lanhuonga3

Show you what can we do with git, not only push and pull.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Git: Why And How to

GIT: Why And How to

Presenter: Huong Nguyen

Skype: lan_huong_a3

Page 2: Git: Why And How to

CONTENT• What is Git

• Basic Use & How to

• Advance Use

• Useful Reference

Page 3: Git: Why And How to

Oops, I need this

Page 4: Git: Why And How to

And this

Page 5: Git: Why And How to

And this

Page 6: Git: Why And How to

And this

Page 7: Git: Why And How to

A contributor to work with

But don’t break the rules

Page 8: Git: Why And How to

And, Finally...

Somebody tell me what did I do with my source?

Page 9: Git: Why And How to

Too much requirements?

Page 10: Git: Why And How to

Let me answer• A Source code management system (SCMS):

• Allows you to track and undo changes.• Allows multiple people to work on the same code at once.• Allows you to make changes to multiple versions of a your

software.• Allows you to deploy software to multiple servers.• Makes Code Development Social through • Notifications, Comments, Wiki & Graphs

Page 11: Git: Why And How to

SVN STORAGE

Page 13: Git: Why And How to

Git Status

Page 14: Git: Why And How to

Git Config & HelpConfig:

● $ git config --global user.name "John Doe"

● $ git config --global user.email [email protected]

Help:

● $ git help <verb>

● $ git <verb> --help

● $ man git-<verb>

Example:

$ git help config

Page 15: Git: Why And How to

Git BasicsWorking with existsing directory

● $ git init

● $ git add README

● $ git commit -m 'initial project version'

● $ git remote add origin https://github.com/schacon/grit.git

● $ git pull

● $ git status

● $ git commit //If neccessary

● $ git push -u origin master

Page 16: Git: Why And How to

Git Basics

Clone from directory: SSH Key

$ git clone [email protected]:/opt/git/my_project.git

Create SSH Key:

https://help.github.com/articles/generating-ssh-keys

Page 17: Git: Why And How to

VERSION CONTROL

GIT TAG: used for creating stable release

$ git tag version1.1

Create tag

$ git push --tags

Push tag to server

Page 18: Git: Why And How to

Good to know● $ git fetch

//Shows what will come down with a pull

● $ git reset HEAD README

//Unstage the last commit

● $ git checkhout --README

//Revert file README

● $ git revert

//Commit changes to undo last commits

● $ git commit -amend

//Modify the last commit

● $ git blame

//Determine who made a specific change

Page 19: Git: Why And How to

GIT Branches

Page 20: Git: Why And How to

Use Branch$ git checkout -b newBranch

create new branch

$ git branch

List all branch

$ git checkout newBranch

Move HEAD to new branch

$ git branch -d iss53

Delete branch iss53

$ git merge iss53

Merge current branch with iss53

Page 22: Git: Why And How to

Some web-based hosting

Page 23: Git: Why And How to

Reference

Git guide from github.io

Set up Git with bitbucket

Pro Git book

Page 24: Git: Why And How to

THANK YOU!