git the wnderfull tool

20
Git By-: Amitoj Singh

Upload: amitoj-singh

Post on 18-Jul-2015

125 views

Category:

Technology


2 download

TRANSCRIPT

Git

By-:Amitoj Singh

Warnings:-

Warning:- This Presentation makes you lazy

Warning: Some Git features are dangerous!

"I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'Git'".

By Linus Torvalds

What is Git?

Version Control

Distributed Control

Git Philosphy

1.Commit early, commit often

2.One commit represents one idea or one change.

3.Your working directory, index, and local repo are your scratch pads.

Staging area / Index

Creating and adding files to repostory

$git init

$git remote add origin https://github.com/User-name/name-of-repository.git

$git pull origin master

$git add filename

$git commit -m "Message"

$git push origin

Git data transport command

Viewing History

$git log

Viewing History

$git log <commit A>..<commit B>

Pointing Fingers:git blame

$git blame <file>

$git blame <commit ID> <file>

Pointing Fingers

Branches

$git branch -a

Branches

$git checkout name

$git checkout -b name <commit>

Patches

$git checkout > file_name.patch

$git diff > file_name.patch

Any Query?