410 likes | 1.45k Views
** DevOps Training: https://www.edureka.co/devops ** <br>This Edureka Git Tutorial explains what is version control system and why Git is the best tool for version control. You will get to learn what is Git through various operations that Git supports. Below are the topics covered in the tutorial: <br><br>1. Version Control System <br>2. Types of Version Control System <br>3. Version Control System Tools <br>4. What is Git? <br>5. Git Features <br>6. Git Workflow <br>7. Parallel Development <br>8. Hands-On <br><br>Check our complete DevOps playlist here (includes all the videos mentioned in the video): http://goo.gl/O2vo13
E N D
Topics For Today’s Session Version Control System 1 Version Control System Types 2 Version Control Tools 3 Git Workflow 4 Parallel Development & Stashing 5 Hands-On 6 Devops Certification Training www.edureka.co/devops
Scenario From Company Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Scenario Of A Company I hope client likes this new feature! Devops Certification Training www.edureka.co/devops
Scenario Of A Company Sure! I will remove this feature I do not like it! So please remove this feature Devops Certification Training www.edureka.co/devops
Scenario Of A Company Hey! I want that feature back! But I have already deleted that code! I have to re write the whole code again Devops Certification Training www.edureka.co/devops
Chaos Caused Without Version Control Downtime may occur due to faulty updates, since there is no backup maintained No collaboration between the team. So no records are maintained. Once saved, all changes are permanent and can’t be reverted back. Devops Certification Training www.edureka.co/devops
Version Control Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Version Control System Version control is the management of changes to documents, computer programs, large web sites, and other collections of information. These changes are usually termed as “versions”. Devops Certification Training www.edureka.co/devops
Version Control Types Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Version Control Types Distributed Version Control System Centralized Version Control System Server Server Repository Repository Push Pull Repository Repository Repository Commit Update Commit Commit Commit Update Update Update Working Copy Working Copy Working Copy Working Copy Working Copy Working Copy Workstation/ PC #1 Workstation/ PC #2 Workstation/ PC #3 Workstation/ PC #1 Workstation/ PC #2 Workstation/ PC #3 Devops Certification Training www.edureka.co/devops
Version Control System Tools Version control has various tools like Git, Apache Subversion, Concurrent Version Systems, Team Foundation Server, Mercurial etc. Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Supports non-linear development of software. Non -Linear Snapshots Distributed Speed Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Distributed Speed Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Every user has his own copy of the repository data stored locally. Distributed Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Speed Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Every user has his own copy of the repository data stored locally. Distributed Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Speed offered by Git is lightening fast compared to other VCS’s. Speed Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Every user has his own copy of the repository data stored locally. Distributed Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Speed offered by Git is lightening fast compared to other VCS’s. Speed Nearly every task in Git is undo-able. Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Every user has his own copy of the repository data stored locally. Distributed Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Speed offered by Git is lightening fast compared to other VCS’s. Speed Nearly every task in Git is undo-able. No changes can be made without Git recording it. Robust Integrity Branching Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Every user has his own copy of the repository data stored locally. Distributed Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Every collaborator’s working directory is in itself a branch. Branching Speed offered by Git is lightening fast compared to other VCS’s. Speed Nearly every task in Git is undo-able. No changes can be made without Git recording it. Robust Integrity Devops Certification Training www.edureka.co/devops
Why Git wins over other tools? Released under GPL’s license. It is for free and is open source. Economical Every user has his own copy of the repository data stored locally. Distributed Supports non-linear development of software. Records changes made to a file rather than file itself. Non -Linear Snapshots Every collaborator’s working directory is in itself a branch. Branching Speed offered by Git is lightening fast compared to other VCS’s. Speed Nearly every task in Git is undo-able. No changes can be made without Git recording it. Robust Integrity Devops Certification Training www.edureka.co/devops
What is Git? Git is an open source Distributed Version Control System(DVCS) which records changes made to the files laying emphasis on speed, data integrity and distributed, non-linear workflows Devops Certification Training www.edureka.co/devops
Workflow of Git Devops Certification Training www.edureka.co/devops
Workflow Of Git Devops Certification Training www.edureka.co/devops
Parallel Development Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Branching Branching is an integral part of any Version Control(VC) System. Unlike other VC’s Git does not create a copy of existing files for new branch. It points to snapshot of the changes you have made in the system Devops Certification Training www.edureka.co/devops
Merging Merging integrates the changes made in different branches into one single branch Devops Certification Training www.edureka.co/devops
Rebasing Used when changes made in one branch needs to be reflected in another branch Devops Certification Training www.edureka.co/devops
Stashing Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Stashing Used when changes made in one branch needs to be reflected in another branch Devops Certification Training www.edureka.co/devops
Hands-On Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Hands-On – Problem Statement Company want a better Source Code Management System because the earlier tool had the tendency to save redundant code. Multiple Developers working simultaneously on same block of code also caused problems. Devops Certification Training www.edureka.co/devops
Hands-On – Solution Task is to move the company’s code base to git and Github. Devops Certification Training www.edureka.co/devops
Git Commands Basic Commands sudo apt-get install git git config --global user.name “username” git rm <filename> git diff git log git commit git add <filename> git init git status git show <tag-name> git tag --a <annotation> --m <message> git rm -f <filename> git pull origin git tag git rm --cached <filename> git push origin master git push origin --tags git fetch origin git add remote origin <remote link> Devops Certification Training www.edureka.co/devops
Git Commands Branching Commands git checkout <branchname> git merge <branchname> git branch <branchname> git branch -D <branchname> git branch -d <branchname> git branch Stashing Commands git stash apply <stash id> git stash list git stash save ‘message’ git stash pop git stash drop <stack id> git stash clear Devops Certification Training www.edureka.co/devops