SlideShare a Scribd company logo
1 of 16
By:
Anuj Sharma
Topics covered:
 GIT Introduction
 GIT Benefits over different tools
 GIT workflow
 GIT server creation
 How to use GIT for first time.
GIT- Introduction
Git is a distributed revision control system with an emphasis on speed, data
integrity, and support for distributed, non-linear workflows. Git was initially
designed and developed by Linus Torvalds for Linux kernel development in 2005,
and has since become the most widely adopted version control system for
software development.
As with most other distributed revision control systems, and unlike most client–
server systems, every Git working directory is a full-fledged repository with
complete history and full version-tracking capabilities, independent of network
access or a central server. Like the Linux kernel, Git is free software distributed
under the terms of the GNU General Public License version 2.
Benefits of GIT over Clearcase
• Atomic commits
• Proper change sets
• Speed
• A proper history browser (so that you can see what changed for a commit,
rather than the individual file nightmare of clearcase)
• Reduced maintenance cost and overhead
• No licensing cost
• GIT is actually being maintained (I know clearcase 8 has a new GUI, but the
underlying tools will still be the same old clunky and rotten relics)
• Merges that are more sophisticated than the dumb text merges of clearcase,
allowing a more flexible branching strategy
• Considerably lower overhead for a developer (can you imagine any system
with higher developer overhead than clearcase!)
• MUCH, MUCH, MUCH easier branching and merging.
• No VOB locking during backups.
• Easier to back up
 Git has a 'clean' command. SVN desperately needs this command, considering
how frequently it will dump extra files on your disk.
 Git has the 'bisect' command. It's nice.
 SVN creates .svn directories in every single folder (Git only creates one .git
directory). Every script you write, and every grep you do, will need to be written to
ignore these .svn directories. You also need an entire command ("svn export") just
to get a sane copy of your files.
 In SVN, each file & folder can come from a different revision or branch. At first,
it sounds nice to have this freedom. But what this actually means is that there is a
million different ways for your local checkout to be completely screwed up. (for
example, if "svn switch" fails halfway through, or if you enter a command wrong).
And the worst part is: if you ever get into a situation where some of your files are
coming from one place, and some of them from another, the "svn status" will tell
you that everything is normal. You'll need to do "svn info" on each file/directory to
discover how weird things are. If "git status" tells you that things are normal, then
you can trust that things really are normal.
 You have to tell SVN whenever you move or delete something. Git will just figure
it out.
Benefits of GIT over SVN
GIT –Basic Workflow
First, we need to install git in our system. It can
be done in many ways. I am giving an example
of Linux. I am using “Ubuntu 13.04 ” Linux
flavor to explain. So, its very simple to install
using below command:
sudo apt-get install git
Now, git is installed in your machine. Just verify it once by running this command:
git --version
Then, someone needs to create the central repository on a server. If it’s a new
project, you can initialize an empty repository. Central repositories should
always be bare repositories (they shouldn’t have a working directory), which
can be created as follows:
git init --bare MyProject.git
You might have noticed the –bare repository created above ended in .git. By
convention, bare git repositories should end in .git. For example, project1.git.
The .git ending of a directory signals to others that the git repository is bare.
The Bare repo contains below things initially:
Since now we have a git repo ready at our server. Now we have to make use of this
centralized repo. All we need to do, is to clone this repo to have a local copy of ours.
Cloning a repo also needs some permission. Now we will check two approaches.
1. Cloning a repo in same server (IP), with different user name. I have one other user
in my server “sharma”.
2. Cloning a repo in different server (IP) will need some special feature “ssh”.
 Create a pub file with your details, using the below command;
ssh-keygen -t rsa -C anuj.sharma@gmail.com
 It will create few pub files, out of which you can just do,
cat .ssh/id_rsa.pub
It will be having "anuj.sharma@gmail.com" at the end, just to verify it got
generated with your details. It can be seen in the below snapshot.
 Create a file with authorized_keys name, and add your pub files to it.
cat .ssh/authorized_keys
 Now change the permissions of authorized_keys as it will act an important
role in providing access to other users.
chmod 700 .ssh/authorized_keys
It can be seen in the below snapshot.
You may add as much as pub files as you want. It will act as an authentication for your
git repo. Now whenever any user want to clone, git admin has to provide access
by adding a pub file to authorized_keys. And your clone command would be
something like this.
git clone server@IP:/home/anuj/git_repos/MyProject.git
It will not ask for password, if pub file is already added.
So, now we have local repo of our own.
We have to check which repo we are using, we can use “git remote -v” to check the
same. It will display the git repo, your are in.
Now, we have to add few things to our git config, so that it will give the information of
user. We need to use below commands as shown in snapshot.
Now, we can start working on our repo. Lets create a test file in git repo “abc.txt”. git
status will give the . It can be shown in below snapshot.
The red color shows that file is not a part of git yet. For this we need to add this file to
git repo, using “git add”
Since this file is added to git, color has been changed to green. It means, it is now
added to staged area of git, from where we can proceed to commit. It can be shown
below:
-s is used for “signed-off by user”
-m is used for “message”
We can check the git log, how it will look.
Commit-id show above is unique to a change.
This presentation ends here, In my next presentation, we will go bit deep and
cover most of the commands with their use cases. Till then you may check the
commands on my blog:
https://anujparashar.wordpress.com/2013/12/29/git-commands-cheetsheet/
Thank you….

More Related Content

What's hot (20)

Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Git learning
Git learningGit learning
Git learning
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git 101
Git 101Git 101
Git 101
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Version control system & how to use git
Version control system & how to use git Version control system & how to use git
Version control system & how to use git
 
Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs github
 
Git
GitGit
Git
 
Quick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHubQuick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHub
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git basics
Git basicsGit basics
Git basics
 
Git
GitGit
Git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 

Viewers also liked

Tarta de bizcocho y helado en una maceta
Tarta de bizcocho y helado en una macetaTarta de bizcocho y helado en una maceta
Tarta de bizcocho y helado en una macetawebosdeoro
 
Implementation of an arithmetic logic using area efficient carry lookahead adder
Implementation of an arithmetic logic using area efficient carry lookahead adderImplementation of an arithmetic logic using area efficient carry lookahead adder
Implementation of an arithmetic logic using area efficient carry lookahead adderVLSICS Design
 
Review of black hole and grey hole attack
Review of black hole and grey hole attackReview of black hole and grey hole attack
Review of black hole and grey hole attackijma
 
A secure routing process to simultaneously defend against false report and wo...
A secure routing process to simultaneously defend against false report and wo...A secure routing process to simultaneously defend against false report and wo...
A secure routing process to simultaneously defend against false report and wo...ieijjournal
 
Ensp energy efficient next hop selection in a probabilistic voting based filt...
Ensp energy efficient next hop selection in a probabilistic voting based filt...Ensp energy efficient next hop selection in a probabilistic voting based filt...
Ensp energy efficient next hop selection in a probabilistic voting based filt...ieijjournal
 
An effective pre processing algorithm for information retrieval systems
An effective pre processing algorithm for information retrieval systemsAn effective pre processing algorithm for information retrieval systems
An effective pre processing algorithm for information retrieval systemsijdms
 
Sample Academic Book Opinion and Reflection - Mamdani
Sample Academic Book Opinion and Reflection - MamdaniSample Academic Book Opinion and Reflection - Mamdani
Sample Academic Book Opinion and Reflection - MamdaniJames Addoms
 
A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12
A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12
A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12Ádám Lechner
 
Wave optics analysis of camera image
Wave optics analysis of camera imageWave optics analysis of camera image
Wave optics analysis of camera imageIJCSEA Journal
 
Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...
Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...
Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...Muhammad Nabeel Musharraf
 
¿Necesito una pantalla o necesito comunicar con mis clientes?
¿Necesito una pantalla o necesito comunicar con mis clientes?¿Necesito una pantalla o necesito comunicar con mis clientes?
¿Necesito una pantalla o necesito comunicar con mis clientes?crambovisuales
 
Dynamic task scheduling on multicore automotive ec us
Dynamic task scheduling on multicore automotive ec usDynamic task scheduling on multicore automotive ec us
Dynamic task scheduling on multicore automotive ec usVLSICS Design
 

Viewers also liked (14)

Tarta de bizcocho y helado en una maceta
Tarta de bizcocho y helado en una macetaTarta de bizcocho y helado en una maceta
Tarta de bizcocho y helado en una maceta
 
Implementation of an arithmetic logic using area efficient carry lookahead adder
Implementation of an arithmetic logic using area efficient carry lookahead adderImplementation of an arithmetic logic using area efficient carry lookahead adder
Implementation of an arithmetic logic using area efficient carry lookahead adder
 
Saberes e Práticas da Inclusão
Saberes e Práticas da InclusãoSaberes e Práticas da Inclusão
Saberes e Práticas da Inclusão
 
Review of black hole and grey hole attack
Review of black hole and grey hole attackReview of black hole and grey hole attack
Review of black hole and grey hole attack
 
A secure routing process to simultaneously defend against false report and wo...
A secure routing process to simultaneously defend against false report and wo...A secure routing process to simultaneously defend against false report and wo...
A secure routing process to simultaneously defend against false report and wo...
 
Ensp energy efficient next hop selection in a probabilistic voting based filt...
Ensp energy efficient next hop selection in a probabilistic voting based filt...Ensp energy efficient next hop selection in a probabilistic voting based filt...
Ensp energy efficient next hop selection in a probabilistic voting based filt...
 
Tech aappt1
Tech aappt1Tech aappt1
Tech aappt1
 
An effective pre processing algorithm for information retrieval systems
An effective pre processing algorithm for information retrieval systemsAn effective pre processing algorithm for information retrieval systems
An effective pre processing algorithm for information retrieval systems
 
Sample Academic Book Opinion and Reflection - Mamdani
Sample Academic Book Opinion and Reflection - MamdaniSample Academic Book Opinion and Reflection - Mamdani
Sample Academic Book Opinion and Reflection - Mamdani
 
A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12
A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12
A hkik programjai a vállalkozások energiaköltségeinek csökkentésére 2013.06.12
 
Wave optics analysis of camera image
Wave optics analysis of camera imageWave optics analysis of camera image
Wave optics analysis of camera image
 
Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...
Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...
Aulad aor waledain ki kitaab || Nasir ud Albani and Hafiz Imran Ayub || Austr...
 
¿Necesito una pantalla o necesito comunicar con mis clientes?
¿Necesito una pantalla o necesito comunicar con mis clientes?¿Necesito una pantalla o necesito comunicar con mis clientes?
¿Necesito una pantalla o necesito comunicar con mis clientes?
 
Dynamic task scheduling on multicore automotive ec us
Dynamic task scheduling on multicore automotive ec usDynamic task scheduling on multicore automotive ec us
Dynamic task scheduling on multicore automotive ec us
 

Similar to Git for a newbie

Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdfAliaaTarek5
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control SystemMd. Mujahid Islam
 
SessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystemsSessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystemsHellen Gakuruh
 
Rc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocidoRc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocidoLuis Bertel
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Hello Git
Hello GitHello Git
Hello Gitbsadd
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneVEXXHOST Private Cloud
 

Similar to Git for a newbie (20)

Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Git introduction
Git introductionGit introduction
Git introduction
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git hub
Git hubGit hub
Git hub
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control System
 
SessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystemsSessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystems
 
Rc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocidoRc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocido
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
Hello Git
Hello GitHello Git
Hello Git
 
Formation git
Formation gitFormation git
Formation git
 
Git 101
Git 101Git 101
Git 101
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Git for a newbie

  • 2. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first time.
  • 3. GIT- Introduction Git is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005, and has since become the most widely adopted version control system for software development. As with most other distributed revision control systems, and unlike most client– server systems, every Git working directory is a full-fledged repository with complete history and full version-tracking capabilities, independent of network access or a central server. Like the Linux kernel, Git is free software distributed under the terms of the GNU General Public License version 2.
  • 4. Benefits of GIT over Clearcase • Atomic commits • Proper change sets • Speed • A proper history browser (so that you can see what changed for a commit, rather than the individual file nightmare of clearcase) • Reduced maintenance cost and overhead • No licensing cost • GIT is actually being maintained (I know clearcase 8 has a new GUI, but the underlying tools will still be the same old clunky and rotten relics) • Merges that are more sophisticated than the dumb text merges of clearcase, allowing a more flexible branching strategy • Considerably lower overhead for a developer (can you imagine any system with higher developer overhead than clearcase!) • MUCH, MUCH, MUCH easier branching and merging. • No VOB locking during backups. • Easier to back up
  • 5.  Git has a 'clean' command. SVN desperately needs this command, considering how frequently it will dump extra files on your disk.  Git has the 'bisect' command. It's nice.  SVN creates .svn directories in every single folder (Git only creates one .git directory). Every script you write, and every grep you do, will need to be written to ignore these .svn directories. You also need an entire command ("svn export") just to get a sane copy of your files.  In SVN, each file & folder can come from a different revision or branch. At first, it sounds nice to have this freedom. But what this actually means is that there is a million different ways for your local checkout to be completely screwed up. (for example, if "svn switch" fails halfway through, or if you enter a command wrong). And the worst part is: if you ever get into a situation where some of your files are coming from one place, and some of them from another, the "svn status" will tell you that everything is normal. You'll need to do "svn info" on each file/directory to discover how weird things are. If "git status" tells you that things are normal, then you can trust that things really are normal.  You have to tell SVN whenever you move or delete something. Git will just figure it out. Benefits of GIT over SVN
  • 6. GIT –Basic Workflow First, we need to install git in our system. It can be done in many ways. I am giving an example of Linux. I am using “Ubuntu 13.04 ” Linux flavor to explain. So, its very simple to install using below command: sudo apt-get install git
  • 7.
  • 8. Now, git is installed in your machine. Just verify it once by running this command: git --version Then, someone needs to create the central repository on a server. If it’s a new project, you can initialize an empty repository. Central repositories should always be bare repositories (they shouldn’t have a working directory), which can be created as follows: git init --bare MyProject.git
  • 9. You might have noticed the –bare repository created above ended in .git. By convention, bare git repositories should end in .git. For example, project1.git. The .git ending of a directory signals to others that the git repository is bare. The Bare repo contains below things initially:
  • 10. Since now we have a git repo ready at our server. Now we have to make use of this centralized repo. All we need to do, is to clone this repo to have a local copy of ours. Cloning a repo also needs some permission. Now we will check two approaches. 1. Cloning a repo in same server (IP), with different user name. I have one other user in my server “sharma”. 2. Cloning a repo in different server (IP) will need some special feature “ssh”.  Create a pub file with your details, using the below command; ssh-keygen -t rsa -C anuj.sharma@gmail.com  It will create few pub files, out of which you can just do, cat .ssh/id_rsa.pub It will be having "anuj.sharma@gmail.com" at the end, just to verify it got generated with your details. It can be seen in the below snapshot.
  • 11.  Create a file with authorized_keys name, and add your pub files to it. cat .ssh/authorized_keys  Now change the permissions of authorized_keys as it will act an important role in providing access to other users. chmod 700 .ssh/authorized_keys It can be seen in the below snapshot.
  • 12. You may add as much as pub files as you want. It will act as an authentication for your git repo. Now whenever any user want to clone, git admin has to provide access by adding a pub file to authorized_keys. And your clone command would be something like this. git clone server@IP:/home/anuj/git_repos/MyProject.git It will not ask for password, if pub file is already added.
  • 13. So, now we have local repo of our own. We have to check which repo we are using, we can use “git remote -v” to check the same. It will display the git repo, your are in. Now, we have to add few things to our git config, so that it will give the information of user. We need to use below commands as shown in snapshot.
  • 14. Now, we can start working on our repo. Lets create a test file in git repo “abc.txt”. git status will give the . It can be shown in below snapshot. The red color shows that file is not a part of git yet. For this we need to add this file to git repo, using “git add”
  • 15. Since this file is added to git, color has been changed to green. It means, it is now added to staged area of git, from where we can proceed to commit. It can be shown below: -s is used for “signed-off by user” -m is used for “message” We can check the git log, how it will look. Commit-id show above is unique to a change.
  • 16. This presentation ends here, In my next presentation, we will go bit deep and cover most of the commands with their use cases. Till then you may check the commands on my blog: https://anujparashar.wordpress.com/2013/12/29/git-commands-cheetsheet/ Thank you….