SlideShare uma empresa Scribd logo
1 de 85
What’s in it for you?
What’s in it for you?
What’s in it for you?
Version Control System
What is Git?
Git Architecture
Git vs GitHub
Fork and Clone
Collaborators
Commands in Git
Git Demo
Branch, Merge and Rebase
Distributed Version Control System
What’s in it for you?
What’s in it for you?Version Control SystemVersion Control System
Version Control System (VCS)
System A
File 2.1File 1.1
Repository
Version 2File 1 File 2
System A
Now we make some changes to the files in System A
File 1 ------> saved as File 1.1
File 2 ------> saved as File 2.1
The new files are stored as Version 2 in the repository
VCS allows you to store multiple versions of a system
file in the remote repository
File 1 File 2
Version 1
All the files in System A are stored as Version 1 in the
remote repository
What’s in it for you?
What’s in it for you?Version Control SystemDistributed Version Control
System
Distributed Version Control System
Distributed VCS
Developer A
Developer B Developer C
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3Version 1
Version 2
Version 3
All the developers have the entire copy of code on
their local system
Distributed Version Control System
Distributed VCS
Developer A
Developer B Developer C
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3Version 1
Version 2
Version 3
Distributed VCS moves from client-server
approach of Central VCS to peer-to-peer
approach
Distributed Version Control System
Distributed VCS
Developer A
Developer B Developer C
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3Version 1
Version 2
Version 3
They can update their local repositories with new data
and push it to the central server
Distributed Version Control System
Distributed VCS
Developer A
Developer B Developer C
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3Version 1
Version 2
Version 3
Git tool is an example of Distributed VCS
Distributed Version Control System
Remote Repository
Commit
Update
Push
Pull
Commit
Update
Push
Pull
Push Pull
Commit Update
Working
Copy
Local
Repository
Working
Copy
Local
Repository
Working
Copy
Local
Repository
What’s in it for you?
What’s in it for you?Version Control SystemWhat is Git?
What is Git?
GitHub Remote
Server
Developer 1 Developer 3
Developer 2 Git is used to track changes in the source code
Git is a distributed version control tool used for source code management
Allows multiple developers to work together
Supports non-linear development because
of thousands of parallel branches
Has the ability to handle large projects efficiently
What’s in it for you?
What’s in it for you?Version Control SystemGit vs GitHub
Git vs GitHub
2
3
4
It is installed on the local system
It is used to manage different versions of the
source code
It provides a command line to interact with the
files
1
2
3
4
GitHub is a service
It is hosted on the web
It is used to have a copy of the local
repository code
It provides a graphical interface to store
the files
1 Git is a software tool
What’s in it for you?
What’s in it for you?Version Control SystemGit Architecture
Git Architecture
Working Directory
Local
Working Directory is the folder
where you are currently working
Git Architecture
Working Directory Staging Area
git add
Local
You add your files to the staging area before
making a commit
Git Architecture
Working Directory Local RepositoryStaging Area
git add
git commit
Local
After making all the changes, you commit those
files to the local repository
Git Architecture
Working Directory Local RepositoryStaging Area Remote Repository
git add
git commit
git push
Local Remote
You can push the committed files to the remote
repository
Git Architecture
Working Directory Local RepositoryStaging Area Remote Repository
git add
git commit
git push
git pull
Local Remote
git pull fetches all the changes from a remote
repository to a local repository
Git Architecture
Working Directory Local RepositoryStaging Area Remote Repository
git add
git commit
git push
git pull
git checkout
Local Remote
You can create new branches and switch to
them as and when required
Git Architecture
Working Directory Local RepositoryStaging Area Remote Repository
git add
git commit
git push
git pull
git checkout
git merge
Local Remote
After you are done with the changes, you can merge
the new branches to the master branch
What’s in it for you?
What’s in it for you?Version Control SystemGit Concepts
Forked
Test_Repository
Fork and Clone
Git Rebase
Pull from a remote
Now that we have
understood Git and it’s
architecture, let’s learn
some git concepts
Git Concepts
Adding Collaborators
Branch in Git
What’s in it for you?
What’s in it for you?Version Control SystemFork and Clone
Fork and Clone
Hey, I want to propose
some changes to your
project
Sure. Go ahead and
Fork it
Fork and Clone
Git allows you to fork an open source repository. When you fork a repository, you create a copy of it on your
GitHub account.
Someone else’s
repository
Your own repository
Forked
Test_Repository
Test_Repository
Fork
Fork and Clone
After you fork a repository, you can clone it and have a copy of it on your local system.
Someone else’s
repository
Your own repository
Forked
Test_Repository
Test_Repository
Fork
Local Repository
Clone to you local
computer from GitHub
What’s in it for you?
What’s in it for you?Version Control SystemCollaborators
Collaborators
Ok, let me add you as a
Collaborator on GitHub
and give you the
permission
Hey, there are some
errors in your code
repository, I need to fix it
Collaborators
GitHub allows you to work with users from all over the world at any given time
Collaborators are GitHub users who are given permission to edit a repository owned by someone else
Anonymous UserRepository’s Owner
Your repository
 Access all the files
 View the files
 Make changes to the files
 Commit the files
What’s in it for you?
What’s in it for you?Version Control SystemBranch in Git
Branch in Git
Suppose you are working on an
application and you want to
add a new feature to the app
You can create a new branch and build the new
feature on that branch
Master branch
New branch
New Feature
Application
 By default, you always work on the master branch
 The circles on the branch represent various commits made on
the branch
Branch in Git
 The diagram shows there are 2 new branches
 You can develop the features you want separately
Branch in Git is used to keep your changes until they are ready
Master Branch
New Branch
New Branch
Application
Branch in Git
 The diagram shows there are 2 new branches
 You can develop the features you want separately
Branch in Git is used to keep your changes until they are ready
 After you develop them completely, you can merge
the newly created branches to the master branch
New Branch
New Branch
Master Branch
Application
What’s in it for you?
What’s in it for you?Version Control SystemGit Merge
Git Merge
a b c
d e f
g
Master
Feature
Master
The base commit of
feature branch is b
There can be multiple
divergent branches
Git Merge
a b c
d e f
g
Master
Feature
Master
The base commit of
feature branch is b
There can be multiple
commits for each new
branch you create
What’s in it for you?
What’s in it for you?Version Control SystemGit Rebase
Git Rebase
a b c
d e f
Master
Feature
f_e_
Feature Feature
d_
Feature
The base commit of feature
branch is changed from b to c
(tip of master)
There is no extra
commit history
Git Rebase
a b c
d e f
Master
Feature
f_e_
Feature Feature
d_
Feature
The base commit of feature
branch is changed from b to c (tip
of master)
Resulting history is linear
with no divergent branches
Git Rebase
Git Rebase is the process of combining a sequence of commits to a new base commit
 The primary reason for rebasing is to maintain a linear project
history
Master
Feature
Git Rebase
Git Rebase is the process of combining a sequence of commits to a new base commit
 The primary reason for rebasing is to maintain a linear project
history
 When you rebase, you “unplug” a branch and “replug” it on
the tip of another branch (usually master)
Master
FeatureFeature
Git Rebase
Git Rebase is the process of combining a sequence of commits to a new base commit
 The primary reason for rebasing is to maintain a linear project
history
 When you rebase, you “unplug” a branch and “replug” it on
the tip of another branch (usually master)
 The goal of rebasing is to take all the commits from a feature
branch and put it on the master branch
Master
FeatureFeature
What’s in it for you?
What’s in it for you?Version Control SystemPull from Remote
Pull from a Remote
Suppose these 2 developers are working
together on an application
Pull from a Remote
They makes changes to their codes and submit
it to the remote repository
Remote
Repository
Pull from a Remote
Both of them want to stay updated with the
recent changes to the repository
Remote
Repository
Pull from a Remote
They can pull the changes from the remote
repository on to their local system
Remote
Repository
Pull from Remote
Repository
Pull from Remote
Repository
Pull from a Remote
Your forked
Repository
Remote
Repository
Local Repository
Pull
Your fork
Repository
 Use the following command to check if there
has been any change
$ git pull <RemoteName> <BranchName>
 If there is no change, it will notify “Already up-
to-date”. If there is an change, it will merge
those changes to your local repository
You can pull in any changes that have been made from your forked remote repository
to the local repository
What’s in it for you?
What’s in it for you?Version Control SystemCommands in Git
Popular Git Commands
git init
Initialize a local Git Repository
git add / git add .
Add one or more files to staging area
git commit –m “commit message”
Commit changes to head but not to the remote
repository
git status
Check the status of your current repository and list
the files you have changed
git log
Provides a list of all the commits made on your
branch
Popular Git Commands
git diff
View the changes you have made to the file
git push origin <branch name>
Push the branch to the remote repository so that others
can use it
Git config –global user.name “Roger”
Tell Git who you are by configuring the author name
Git config –global user.email roger.1@gmail.com
Tell Git who you are by configuring the author
email id
git clone
Creates a Git repository copy from a remote source
Popular Git Commands
git remote add origin <server>
Connect your local repository to the remote server
and add the server to be able to push to it
git branch <branch name>
Create a new branch
git checkout <branch name>
Switch from one branch to another
git merge <branch name>
Merge a branch into the active branch
git rebase
Reapply commits on top of another base tip
What’s in it for you?
What’s in it for you?Version Control SystemDemo on Git
Demo on Git
1. Create a Repository
Create a “hello-world” folder
Move to hello-world folder
Create a new Git instance for a project
Demo on Git
1. Create a Repository
Create a file called readme.txt in the hello-world folder
Check the status of the repository to find out if there have been changes
Demo on Git
2. Create a new file, add something to that file and commit those changes to Git
Add the file you just created to the files you would like to commit to change
Commit those changes to the repository’s history
Demo on Git
2. Create a new file, add something to that file and commit those changes to Git
Add another line to readme.txt and save
View the difference between the file now and how it was at your last commit
Demo on Git
3. Create a GitHub account, add username to your Git configuration
Sign up to GitHub account by visiting github.com
Add your GitHub username to your Git Configuration
Demo on Git
4. Connect your local and remote repositories and push changes
Github.com Log in
Click the + sign in the top
right
Create a Remote repository
Demo on Git
4. Connect your local and remote repositories and push changes
Connect your local to your Remote
Push your file to remote
Demo on Git
5. Fork a project from github.com and clone it locally
Github.com/jlord/patchwork
Click the fork button at
the top right
Once the fork is complete, you will get a copy on your account. Copy your fork’s HTTP URL on the right sidebar
Someone else’s
repository
Your own repository
Forked
Test_Repository
Test_Repository
Fork
Fork Patchwork Repository: We’ll be using github.com/jlord/patchwork
Demo on Git
5. Fork a project from github.com and clone it locally
Change the directory
Clone the repository onto your computer
Demo on Git
5. Fork a project from github.com and clone it locally
Now, you have got a copy of the repository on your local
computer which is automatically connected to the remote
repository
Go into the folder for the fork it created
If the original repository you forked from has some changes, you’d want to pull those changes as well. So, you need to add another
remote connection to the original repository with its URL
Someone else’s
repository
Your own repository
Forked
Test_Repository
Test_Repository
Fork
Local
Repository
Clone to you local
computer from
GitHubTest_Repository
Demo on Git
5. Fork a project from github.com and clone it locally
Demo on Git
6. Create a new branch on your fork for your contribution
Name of the branch is:
add-Simplilearn
Master Branch
add-Simplilearn
Create a new branch
Demo on Git
6. Create a new branch on your fork for your contribution
Checkout your branch and go onto a new branch
Push your update to your fork on GitHub
Demo on Git
7. Add a collaborator to your project
Visit the repository’s GitHub
page
Click settings icon on
the right side menu
Select the collaborators
tab
Type the username and
click add
Add “reporobot” as a collaborator to your forked Patchwork repository’s page
Demo on Git
8. Keep your file up to date by pulling in changes from collaborators
It will give a message “Already up to date”, if nothing has changed. If there are changes, it will merge those changes into your
local version.
Check if Reporobot has made any changes to your branch
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Create a new local repository called test
Move to the test folder
Create a new git instance
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Create 2 text files “test1” and “test2” in the test repository
Add the two files to master branch and make a commit
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Create a new branch “test_branch”
Create a new text file “test3”
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Add test3 file to the new branch
Move from the master branch to test_branch
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Merge test_branch file to master branch
The master branch has all the files now
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Move from the master branch to test_branch
Modify test3 file and commit the changes
Demo on Git
9. Create a new branch, make changes and merge it to the master branch
Check the test3 file in master branch
The file has not been modified in the
master branch
Check the file in test_branch
Switch to the master branch
Demo on Git
10. Rebase the newly created files on to master branch
Create 2 new text files test4 and test5
Switch to test_branch
Demo on Git
10. Rebase the newly created files on to master branch
Add the files to test branch
Commit the files for rebasing
Demo on Git
10. Rebase the newly created files on to master branch
List the files in test_branch
Switch to the master branch
Demo on Git
10. Rebase the newly created files on to master branch
List the files in the master branch
Switch to test_branch
Rebase master branch
Demo on Git
10. Rebase the newly created files on to master branch
Rebase master branch
Switch to master branch
Demo on Git
10. Rebase the newly created files on to master branch
Rebase test_branch
List the files in master branch
Key Takeaways
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps Tutorial | Simplilearn

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
 
Git slides
Git slidesGit slides
Git slides
 
Git basics
Git basicsGit basics
Git basics
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
Git training v10
Git training v10Git training v10
Git training v10
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Github basics
Github basicsGithub basics
Github basics
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git basic
Git basicGit basic
Git basic
 

Semelhante a Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps Tutorial | Simplilearn

Semelhante a Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps Tutorial | Simplilearn (20)

GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git hub_pptx
Git hub_pptxGit hub_pptx
Git hub_pptx
 
Git&GitHub.pptx
Git&GitHub.pptxGit&GitHub.pptx
Git&GitHub.pptx
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Git
GitGit
Git
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
Git the fast version control system
Git the fast version control systemGit the fast version control system
Git the fast version control system
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
Git for developers
Git for developersGit for developers
Git for developers
 
02-version control(DevOps Series)
02-version control(DevOps Series)02-version control(DevOps Series)
02-version control(DevOps Series)
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Exploring Git in Visual Studio 2013
Exploring Git in Visual Studio 2013Exploring Git in Visual Studio 2013
Exploring Git in Visual Studio 2013
 

Mais de Simplilearn

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in CybersecuritySimplilearn
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptxSimplilearn
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023 Simplilearn
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Simplilearn
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Simplilearn
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...Simplilearn
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Simplilearn
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...Simplilearn
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Simplilearn
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...Simplilearn
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Simplilearn
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Simplilearn
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Simplilearn
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...Simplilearn
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...Simplilearn
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...Simplilearn
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...Simplilearn
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Simplilearn
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...Simplilearn
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...Simplilearn
 

Mais de Simplilearn (20)

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in Cybersecurity
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptx
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 

Último (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps Tutorial | Simplilearn

  • 1. What’s in it for you? What’s in it for you?
  • 2. What’s in it for you? Version Control System What is Git? Git Architecture Git vs GitHub Fork and Clone Collaborators Commands in Git Git Demo Branch, Merge and Rebase Distributed Version Control System
  • 3. What’s in it for you? What’s in it for you?Version Control SystemVersion Control System
  • 4. Version Control System (VCS) System A File 2.1File 1.1 Repository Version 2File 1 File 2 System A Now we make some changes to the files in System A File 1 ------> saved as File 1.1 File 2 ------> saved as File 2.1 The new files are stored as Version 2 in the repository VCS allows you to store multiple versions of a system file in the remote repository File 1 File 2 Version 1 All the files in System A are stored as Version 1 in the remote repository
  • 5. What’s in it for you? What’s in it for you?Version Control SystemDistributed Version Control System
  • 6. Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 All the developers have the entire copy of code on their local system
  • 7. Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 Distributed VCS moves from client-server approach of Central VCS to peer-to-peer approach
  • 8. Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 They can update their local repositories with new data and push it to the central server
  • 9. Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 Git tool is an example of Distributed VCS
  • 10. Distributed Version Control System Remote Repository Commit Update Push Pull Commit Update Push Pull Push Pull Commit Update Working Copy Local Repository Working Copy Local Repository Working Copy Local Repository
  • 11. What’s in it for you? What’s in it for you?Version Control SystemWhat is Git?
  • 12. What is Git? GitHub Remote Server Developer 1 Developer 3 Developer 2 Git is used to track changes in the source code Git is a distributed version control tool used for source code management Allows multiple developers to work together Supports non-linear development because of thousands of parallel branches Has the ability to handle large projects efficiently
  • 13. What’s in it for you? What’s in it for you?Version Control SystemGit vs GitHub
  • 14. Git vs GitHub 2 3 4 It is installed on the local system It is used to manage different versions of the source code It provides a command line to interact with the files 1 2 3 4 GitHub is a service It is hosted on the web It is used to have a copy of the local repository code It provides a graphical interface to store the files 1 Git is a software tool
  • 15. What’s in it for you? What’s in it for you?Version Control SystemGit Architecture
  • 16. Git Architecture Working Directory Local Working Directory is the folder where you are currently working
  • 17. Git Architecture Working Directory Staging Area git add Local You add your files to the staging area before making a commit
  • 18. Git Architecture Working Directory Local RepositoryStaging Area git add git commit Local After making all the changes, you commit those files to the local repository
  • 19. Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push Local Remote You can push the committed files to the remote repository
  • 20. Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push git pull Local Remote git pull fetches all the changes from a remote repository to a local repository
  • 21. Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push git pull git checkout Local Remote You can create new branches and switch to them as and when required
  • 22. Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push git pull git checkout git merge Local Remote After you are done with the changes, you can merge the new branches to the master branch
  • 23. What’s in it for you? What’s in it for you?Version Control SystemGit Concepts
  • 24. Forked Test_Repository Fork and Clone Git Rebase Pull from a remote Now that we have understood Git and it’s architecture, let’s learn some git concepts Git Concepts Adding Collaborators Branch in Git
  • 25. What’s in it for you? What’s in it for you?Version Control SystemFork and Clone
  • 26. Fork and Clone Hey, I want to propose some changes to your project Sure. Go ahead and Fork it
  • 27. Fork and Clone Git allows you to fork an open source repository. When you fork a repository, you create a copy of it on your GitHub account. Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork
  • 28. Fork and Clone After you fork a repository, you can clone it and have a copy of it on your local system. Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Local Repository Clone to you local computer from GitHub
  • 29. What’s in it for you? What’s in it for you?Version Control SystemCollaborators
  • 30. Collaborators Ok, let me add you as a Collaborator on GitHub and give you the permission Hey, there are some errors in your code repository, I need to fix it
  • 31. Collaborators GitHub allows you to work with users from all over the world at any given time Collaborators are GitHub users who are given permission to edit a repository owned by someone else Anonymous UserRepository’s Owner Your repository  Access all the files  View the files  Make changes to the files  Commit the files
  • 32. What’s in it for you? What’s in it for you?Version Control SystemBranch in Git
  • 33. Branch in Git Suppose you are working on an application and you want to add a new feature to the app You can create a new branch and build the new feature on that branch Master branch New branch New Feature Application  By default, you always work on the master branch  The circles on the branch represent various commits made on the branch
  • 34. Branch in Git  The diagram shows there are 2 new branches  You can develop the features you want separately Branch in Git is used to keep your changes until they are ready Master Branch New Branch New Branch Application
  • 35. Branch in Git  The diagram shows there are 2 new branches  You can develop the features you want separately Branch in Git is used to keep your changes until they are ready  After you develop them completely, you can merge the newly created branches to the master branch New Branch New Branch Master Branch Application
  • 36. What’s in it for you? What’s in it for you?Version Control SystemGit Merge
  • 37. Git Merge a b c d e f g Master Feature Master The base commit of feature branch is b There can be multiple divergent branches
  • 38. Git Merge a b c d e f g Master Feature Master The base commit of feature branch is b There can be multiple commits for each new branch you create
  • 39. What’s in it for you? What’s in it for you?Version Control SystemGit Rebase
  • 40. Git Rebase a b c d e f Master Feature f_e_ Feature Feature d_ Feature The base commit of feature branch is changed from b to c (tip of master) There is no extra commit history
  • 41. Git Rebase a b c d e f Master Feature f_e_ Feature Feature d_ Feature The base commit of feature branch is changed from b to c (tip of master) Resulting history is linear with no divergent branches
  • 42. Git Rebase Git Rebase is the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history Master Feature
  • 43. Git Rebase Git Rebase is the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history  When you rebase, you “unplug” a branch and “replug” it on the tip of another branch (usually master) Master FeatureFeature
  • 44. Git Rebase Git Rebase is the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history  When you rebase, you “unplug” a branch and “replug” it on the tip of another branch (usually master)  The goal of rebasing is to take all the commits from a feature branch and put it on the master branch Master FeatureFeature
  • 45. What’s in it for you? What’s in it for you?Version Control SystemPull from Remote
  • 46. Pull from a Remote Suppose these 2 developers are working together on an application
  • 47. Pull from a Remote They makes changes to their codes and submit it to the remote repository Remote Repository
  • 48. Pull from a Remote Both of them want to stay updated with the recent changes to the repository Remote Repository
  • 49. Pull from a Remote They can pull the changes from the remote repository on to their local system Remote Repository Pull from Remote Repository Pull from Remote Repository
  • 50. Pull from a Remote Your forked Repository Remote Repository Local Repository Pull Your fork Repository  Use the following command to check if there has been any change $ git pull <RemoteName> <BranchName>  If there is no change, it will notify “Already up- to-date”. If there is an change, it will merge those changes to your local repository You can pull in any changes that have been made from your forked remote repository to the local repository
  • 51. What’s in it for you? What’s in it for you?Version Control SystemCommands in Git
  • 52. Popular Git Commands git init Initialize a local Git Repository git add / git add . Add one or more files to staging area git commit –m “commit message” Commit changes to head but not to the remote repository git status Check the status of your current repository and list the files you have changed git log Provides a list of all the commits made on your branch
  • 53. Popular Git Commands git diff View the changes you have made to the file git push origin <branch name> Push the branch to the remote repository so that others can use it Git config –global user.name “Roger” Tell Git who you are by configuring the author name Git config –global user.email roger.1@gmail.com Tell Git who you are by configuring the author email id git clone Creates a Git repository copy from a remote source
  • 54. Popular Git Commands git remote add origin <server> Connect your local repository to the remote server and add the server to be able to push to it git branch <branch name> Create a new branch git checkout <branch name> Switch from one branch to another git merge <branch name> Merge a branch into the active branch git rebase Reapply commits on top of another base tip
  • 55. What’s in it for you? What’s in it for you?Version Control SystemDemo on Git
  • 56. Demo on Git 1. Create a Repository Create a “hello-world” folder Move to hello-world folder Create a new Git instance for a project
  • 57. Demo on Git 1. Create a Repository Create a file called readme.txt in the hello-world folder Check the status of the repository to find out if there have been changes
  • 58. Demo on Git 2. Create a new file, add something to that file and commit those changes to Git Add the file you just created to the files you would like to commit to change Commit those changes to the repository’s history
  • 59. Demo on Git 2. Create a new file, add something to that file and commit those changes to Git Add another line to readme.txt and save View the difference between the file now and how it was at your last commit
  • 60. Demo on Git 3. Create a GitHub account, add username to your Git configuration Sign up to GitHub account by visiting github.com Add your GitHub username to your Git Configuration
  • 61. Demo on Git 4. Connect your local and remote repositories and push changes Github.com Log in Click the + sign in the top right Create a Remote repository
  • 62. Demo on Git 4. Connect your local and remote repositories and push changes Connect your local to your Remote Push your file to remote
  • 63. Demo on Git 5. Fork a project from github.com and clone it locally Github.com/jlord/patchwork Click the fork button at the top right Once the fork is complete, you will get a copy on your account. Copy your fork’s HTTP URL on the right sidebar Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Fork Patchwork Repository: We’ll be using github.com/jlord/patchwork
  • 64. Demo on Git 5. Fork a project from github.com and clone it locally Change the directory Clone the repository onto your computer
  • 65. Demo on Git 5. Fork a project from github.com and clone it locally Now, you have got a copy of the repository on your local computer which is automatically connected to the remote repository Go into the folder for the fork it created If the original repository you forked from has some changes, you’d want to pull those changes as well. So, you need to add another remote connection to the original repository with its URL Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Local Repository Clone to you local computer from GitHubTest_Repository
  • 66. Demo on Git 5. Fork a project from github.com and clone it locally
  • 67. Demo on Git 6. Create a new branch on your fork for your contribution Name of the branch is: add-Simplilearn Master Branch add-Simplilearn Create a new branch
  • 68. Demo on Git 6. Create a new branch on your fork for your contribution Checkout your branch and go onto a new branch Push your update to your fork on GitHub
  • 69. Demo on Git 7. Add a collaborator to your project Visit the repository’s GitHub page Click settings icon on the right side menu Select the collaborators tab Type the username and click add Add “reporobot” as a collaborator to your forked Patchwork repository’s page
  • 70. Demo on Git 8. Keep your file up to date by pulling in changes from collaborators It will give a message “Already up to date”, if nothing has changed. If there are changes, it will merge those changes into your local version. Check if Reporobot has made any changes to your branch
  • 71. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Create a new local repository called test Move to the test folder Create a new git instance
  • 72. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Create 2 text files “test1” and “test2” in the test repository Add the two files to master branch and make a commit
  • 73. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Create a new branch “test_branch” Create a new text file “test3”
  • 74. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Add test3 file to the new branch Move from the master branch to test_branch
  • 75. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Merge test_branch file to master branch The master branch has all the files now
  • 76. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Move from the master branch to test_branch Modify test3 file and commit the changes
  • 77. Demo on Git 9. Create a new branch, make changes and merge it to the master branch Check the test3 file in master branch The file has not been modified in the master branch Check the file in test_branch Switch to the master branch
  • 78. Demo on Git 10. Rebase the newly created files on to master branch Create 2 new text files test4 and test5 Switch to test_branch
  • 79. Demo on Git 10. Rebase the newly created files on to master branch Add the files to test branch Commit the files for rebasing
  • 80. Demo on Git 10. Rebase the newly created files on to master branch List the files in test_branch Switch to the master branch
  • 81. Demo on Git 10. Rebase the newly created files on to master branch List the files in the master branch Switch to test_branch Rebase master branch
  • 82. Demo on Git 10. Rebase the newly created files on to master branch Rebase master branch Switch to master branch
  • 83. Demo on Git 10. Rebase the newly created files on to master branch Rebase test_branch List the files in master branch

Notas do Editor

  1. Style - 01
  2. Style - 01
  3. Style - 01
  4. Style - 01
  5. Style - 01
  6. Style - 01
  7. Style - 01
  8. Style - 01
  9. Style - 01
  10. Style - 01
  11. Style - 01
  12. Style - 01
  13. Style - 01
  14. Style - 01
  15. Style - 01
  16. Style - 01
  17. Style - 01
  18. Style - 01
  19. Style - 01
  20. Style - 01
  21. Style - 01
  22. Style - 01
  23. Style - 01
  24. Style - 01
  25. Style - 01
  26. Style - 01
  27. Style - 01
  28. Style - 01
  29. Style - 01
  30. Style - 01
  31. Style - 01
  32. Style - 01
  33. Style - 01
  34. Style - 01
  35. Style - 01
  36. Style - 01
  37. Style - 01
  38. Style - 01
  39. Style - 01
  40. Style - 01
  41. Style - 01
  42. Style - 01
  43. Style - 01
  44. Style - 01
  45. Style - 01
  46. Style - 01
  47. Style - 01
  48. Style - 01
  49. Style - 01
  50. Style - 01
  51. Style - 01
  52. Style - 01
  53. Style - 01
  54. Style - 01
  55. Style - 01
  56. Style - 01
  57. Style - 01
  58. Style - 01
  59. Style - 01
  60. Style - 01
  61. Style - 01
  62. Style - 01
  63. Style - 01
  64. Style - 01
  65. Style - 01