Top Banner
Git By-: Amitoj Singh
20
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 the Wnderfull tool

Git

By-:Amitoj Singh

Page 2: Git the Wnderfull tool

Warnings:-

Page 3: Git the Wnderfull tool

Warning:- This Presentation makes you lazy

Page 4: Git the Wnderfull tool

Warning: Some Git features are dangerous!

Page 5: Git the Wnderfull tool

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

By Linus Torvalds

Page 6: Git the Wnderfull tool

What is Git?

Page 7: Git the Wnderfull tool

Version Control

Page 8: Git the Wnderfull tool

Distributed Control

Page 9: Git the Wnderfull tool

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.

Page 10: Git the Wnderfull tool

Staging area / Index

Page 11: Git the Wnderfull tool

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

Page 12: Git the Wnderfull tool

Git data transport command

Page 13: Git the Wnderfull tool

Viewing History

Page 14: Git the Wnderfull tool

$git log

Viewing History

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

Page 15: Git the Wnderfull tool

Pointing Fingers:git blame

Page 16: Git the Wnderfull tool

$git blame <file>

$git blame <commit ID> <file>

Pointing Fingers

Page 17: Git the Wnderfull tool

Branches

Page 18: Git the Wnderfull tool

$git branch -a

Branches

$git checkout name

$git checkout -b name <commit>

Page 19: Git the Wnderfull tool

Patches

$git checkout > file_name.patch

$git diff > file_name.patch

Page 20: Git the Wnderfull tool

Any Query?