Git
By-:Amitoj Singh
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
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
$git log
Viewing History
$git log <commit A>..<commit B>
Pointing Fingers:git blame
$git blame <file>
$git blame <commit ID> <file>
Pointing Fingers
$git branch -a
Branches
$git checkout name
$git checkout -b name <commit>
Patches
$git checkout > file_name.patch
$git diff > file_name.patch