“ Ini oru vidhi seivom (Lets make a new beginning) – Lets make it right!”
Lets git to it
-
Upload
yoram-michaeli -
Category
Technology
-
view
4.276 -
download
0
Transcript of Lets git to it
![Page 2: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/2.jpg)
Before you GIT it...
![Page 3: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/3.jpg)
What is GIT?
![Page 4: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/4.jpg)
What is GIT?
● GIT is a distributed revision controland source code management system(DVCS)
● GIT were created, designed and developed by Linus Torvalds (the creator of Linux) for Linux kernel development.(See Linus Torvalds in YouTube )
● Official GIT site: http://git-scm.com
![Page 5: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/5.jpg)
Why use GIT?
![Page 6: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/6.jpg)
Why use GIT?There are many other SCM/SVCS systems out there...
GIT is fast
GIT has no need for network connection - for most operations
GIT is a great merge and branching tool
GIT is a modern tool
GIT have a very large install-base
GIT encourage developers to commit, which results with less data loose
![Page 7: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/7.jpg)
GIT is distributed
● There is no single server – each endpoint contains all the information.
● Usually there is one endpoint that is considered as the central one but this is not a must.
● The common flow:● You clone the central repository and sync with its
content● You work offline on your private repository● You push your local changes into the central
repository
![Page 8: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/8.jpg)
GIT is distributed
![Page 9: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/9.jpg)
GIT is fast
● For most operation you don't need network connection
● Network operations are done very fast using modern and validated transfer actions
● GIT uses snapshots of the whole repository instead of the files-and-delta technology
● GIT uses pointers● GIT is optimized for merge...
![Page 10: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/10.jpg)
GIT is optimized for merge
● GIT is designed for fast and efficient merge● GIT supports:
● Local merge● 2 repositories/endpoints merge● Simultaneously work on the same resource
● Merge is usually done locally before pushing it to the remote repository so it is very easy to abort it or revert to the previous status
![Page 11: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/11.jpg)
Things you must consider about GIT
![Page 12: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/12.jpg)
Things you must consider about GIT
● GIT requires you to understand it for using it● GIT is not CVS or SVN or any of those tools● GIT requires much to learn about it● GIT command line interface (CLI) is the most
recommended client for it
![Page 13: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/13.jpg)
GIT concepts overview
![Page 14: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/14.jpg)
SVN/CVS vs. GIT
![Page 15: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/15.jpg)
GIT commit representation
![Page 16: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/16.jpg)
GIT repository – the multiple commit concept
Each commit store a pointer to the former (checksum) commit The first commit has a null pointer
![Page 17: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/17.jpg)
GIT branches – basic terms
branch – a pointer to some commitmaster – the “default” branchHEAD – the current branch of the local/remote repositoryorigin – the remote repository (usually – the one you have cloned from)origin/master – the master branch (pointer) of the origin repository
![Page 18: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/18.jpg)
GIT local workGIT directoryis where Git stores the metadata and object database for your project
Working directoryis a single checkout of one version of the project on your disk.
Staging area (Index)is a simple snapshot file in your Git directory, that stores information about what will go into your next commit.
Why staging?Gives you the ability to control the content of your next commitYou can reset changesYou can 'stash' all changes and work on a new task in the same locationOnce your done with your code – for committing - you can:
Review the differences between working directory and stagingReview the differences between staging and HEAD
![Page 19: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/19.jpg)
A GIT file life-cycle
![Page 20: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/20.jpg)
GIT basic flow and operations
![Page 21: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/21.jpg)
The common flow:● You clone the central repository and sync with its content:
– Method 1:
> git pull
– Method 2:
> git fetch > git rebase
● You work offline on your private repository
> git add --all > git commit -m “<comment>”
● You push your local changes into the central repository
> git push origin master
GIT basic flow
![Page 22: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/22.jpg)
GIT common actions & flow
![Page 23: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/23.jpg)
● git clone – clone a repository into a new copy● git status – show the status of your local repository
git log – show commit logs
git diff - show the differences between anything: states, branches and more
git branch – perform branch-related actions such as create branch, list branches and more
git checkout – switch to work on a certain snapshot (branch, hash, tag)
git merge – merge into current working snapshot
git cherrypick – merge picked commits from branch to branch
Other GIT common commands
![Page 24: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/24.jpg)
Let's GIT startedInstall GIT (usually from http://git-scm.com/)Initial global settings
> git config --global user.name “Bill Gates”
> git config --global user.email “[email protected]”
> git config --global color.ui true
git init > mkdir microsoft
> cd microsoft
> git init
or git clone > cd Microsoft
> git clone git@microsoft:acquired-companies/someTool.git
![Page 25: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/25.jpg)
GIT tools
![Page 26: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/26.jpg)
GIT hosting tools and services
![Page 27: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/27.jpg)
GIT cloud-based hosting services
https://git.wiki.kernel.org/index.php/GitHosting
![Page 28: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/28.jpg)
GIT on-premise hosting tools
http://en.wikipedia.org/wiki/Comparison_of_free_software_hosting_facilities
![Page 29: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/29.jpg)
Detailed guideline for choosing GIT host service
http://www.slideshare.net/YoramMichaeli/git-hostingservice
![Page 30: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/30.jpg)
GIT client tools
![Page 31: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/31.jpg)
GIT GUI client tools
https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools
SourceTree
GitHub
GitX
Gitg
SmartGit
![Page 32: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/32.jpg)
GIT branching model
![Page 33: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/33.jpg)
GIT branching modelbased on http://nvie.com/posts/a-successful-git-branching-model
![Page 34: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/34.jpg)
GIT more
![Page 35: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/35.jpg)
Other GIT great starting points
Pro GitGIT REAL
![Page 36: Lets git to it](https://reader034.fdocuments.net/reader034/viewer/2022050613/58ecd55e1a28abc5438b471b/html5/thumbnails/36.jpg)