Version Control System
GIT
Version control is a system that records changes to a file or
set of files over time so that you can recall specific versions
later
About Me
Palash Kanti Bachar
Tech Lead, Sharepoint & .Net Team
Professional Trainer
Agenda
● Version Control System
● What is Git
● Setup Git
● Create New Project
● Basic Snapshotting
● Branching & Merging
● Sharing & Updating Projects
● Inspection & Comparison
● Patching
● Ref Git - Reference (git-scm.com)
Version Control Systems
❏ Easily Management collaboration on a project by avoiding frustration of
swapping files.
❏ Ability to have unlimited number of developers working on the same code
base.
❏ Easily revert back to your files if something happened.
➢ Centralized Version Control Systems
➢ Distributed Version COntrol SYstems
Centralized Version Control Systems
❏ These systems (such as CVS, Subversion, and Perforce) have a single server that
contains all the versioned files, and a number of clients that check out files from
that central place
❏ Everyone knows to a certain degree
what everyone else on the project is doing.
Distributed Version Control Systems
❏ In a DVCS, clients don’t just check out the latest snapshot of the files; rather, they
fully mirror the repository, including its full history.
❏ Every clone is really a full backup of all the data.
What is GIT?
● GIT is free and open source distributed system with the emphasis on speed
and data integrity.
● Git thinks about its data more like a stream of snapshots.
Setup Git?
❏ Download git from Git - Downloads (git-scm.com)
Setup the download file
❏ To check the version git --version
❏ To View all the Settings
❏ To Change your identify
❏ To change default branch Name
Creating Project?
❏ To init the project git init
❏ To add all files git add .
❏ To commit the files git commit -m “Palash: Project init”
❏ To push the changes in github git remote add origin <repo-url>
❏ To push code git push origin master
❏ To clone the repository git clone <repo-url>
.git Directory Structure
GIT State Operation?
❏ There are 3 states in git (Modified, Staged, Committed)
❏ Modified means that you have changed the file but have not committed it to your
database yet.
❏ Staged means that you have marked a modified file in its current version to go into
your next commit snapshot.
❏ Committed means that the data is safely stored in your local database.
GIT State Operation?
Basic Command
❏ ADD: To add file git add <fileName> git add .
❏ STATUS: To show the status git status
-s short, -b branch, –show-stash, –long
❏ DIFF: To show the diff git diff
❏ COMMIT: To commit git commit -m <Message>
❏ NOTES: To add the notes git notes add -m 'Tested-by: Palash' <commit Ref>
To show notes git show -s <commit ref>
❏ RESTORE: To restore the files git restore hello.c
❏ RESET: Reset current HEAD git reset --hard HEAD
Branching & Merging
❏ BRANCH: To show all branch git branch -a
To create branch git branch dev
To Delete branch git branch -d dev, remote git push origin -d dev
❏ CHECKOUT: To checkout git checkout <branchname>
❏ MERGE: To merge git merge <branchName>, git merge origin/staging
❏ MERGETOOL: To resolve the conflict git mergetool
❏ LOG: To show logs git log
❏ STASH : To changes in a dirty working directory git stash
❏ TAG: Create, list, delete or verify a tag object signed with GPG git tag test
❏ WORK TREE: Reset current HEAD git reset --hard HEAD
Sharing and Updating Projects
❏ FETCH: To download objects and refs from the repository git fetch -a
❏ PULL: Fetch from and integrate with another repository or a local branch
git pull origin <branchname>
❏ PUSH: Update remote refs along with associated objects git push origin
<branch>
❏ REMOTE: Manage set of tracked repositories git remote
❏ SUBMODULE: Initialize, update or inspect submodules
git submodule add https://github.com/chaconinc/DbConnector
Inspection & Comparison
❏ SHOW: To Show various types of objects git show
❏ LOG: Fetch from and integrate with another repository or a local branch
git log
❏ DIFF: Show changes between commits, commit and working tree, etc git
diff
❏ DIFFTOOL: Show changes using common diff tools git difftool
❏ SHORTLOG: Summarize git log output
git shortlog
Visual Studio Git Features
❏ Show details in Demo
Be a professional, care about your code
Thank You!

Git.pptx

  • 1.
    Version Control System GIT Versioncontrol is a system that records changes to a file or set of files over time so that you can recall specific versions later
  • 2.
    About Me Palash KantiBachar Tech Lead, Sharepoint & .Net Team Professional Trainer
  • 3.
    Agenda ● Version ControlSystem ● What is Git ● Setup Git ● Create New Project ● Basic Snapshotting ● Branching & Merging ● Sharing & Updating Projects ● Inspection & Comparison ● Patching ● Ref Git - Reference (git-scm.com)
  • 4.
    Version Control Systems ❏Easily Management collaboration on a project by avoiding frustration of swapping files. ❏ Ability to have unlimited number of developers working on the same code base. ❏ Easily revert back to your files if something happened. ➢ Centralized Version Control Systems ➢ Distributed Version COntrol SYstems
  • 5.
    Centralized Version ControlSystems ❏ These systems (such as CVS, Subversion, and Perforce) have a single server that contains all the versioned files, and a number of clients that check out files from that central place ❏ Everyone knows to a certain degree what everyone else on the project is doing.
  • 6.
    Distributed Version ControlSystems ❏ In a DVCS, clients don’t just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history. ❏ Every clone is really a full backup of all the data.
  • 7.
    What is GIT? ●GIT is free and open source distributed system with the emphasis on speed and data integrity. ● Git thinks about its data more like a stream of snapshots.
  • 8.
    Setup Git? ❏ Downloadgit from Git - Downloads (git-scm.com) Setup the download file ❏ To check the version git --version ❏ To View all the Settings ❏ To Change your identify ❏ To change default branch Name
  • 9.
    Creating Project? ❏ Toinit the project git init ❏ To add all files git add . ❏ To commit the files git commit -m “Palash: Project init” ❏ To push the changes in github git remote add origin <repo-url> ❏ To push code git push origin master ❏ To clone the repository git clone <repo-url>
  • 10.
  • 11.
    GIT State Operation? ❏There are 3 states in git (Modified, Staged, Committed) ❏ Modified means that you have changed the file but have not committed it to your database yet. ❏ Staged means that you have marked a modified file in its current version to go into your next commit snapshot. ❏ Committed means that the data is safely stored in your local database.
  • 12.
  • 13.
    Basic Command ❏ ADD:To add file git add <fileName> git add . ❏ STATUS: To show the status git status -s short, -b branch, –show-stash, –long ❏ DIFF: To show the diff git diff ❏ COMMIT: To commit git commit -m <Message> ❏ NOTES: To add the notes git notes add -m 'Tested-by: Palash' <commit Ref> To show notes git show -s <commit ref> ❏ RESTORE: To restore the files git restore hello.c ❏ RESET: Reset current HEAD git reset --hard HEAD
  • 14.
    Branching & Merging ❏BRANCH: To show all branch git branch -a To create branch git branch dev To Delete branch git branch -d dev, remote git push origin -d dev ❏ CHECKOUT: To checkout git checkout <branchname> ❏ MERGE: To merge git merge <branchName>, git merge origin/staging ❏ MERGETOOL: To resolve the conflict git mergetool ❏ LOG: To show logs git log ❏ STASH : To changes in a dirty working directory git stash ❏ TAG: Create, list, delete or verify a tag object signed with GPG git tag test ❏ WORK TREE: Reset current HEAD git reset --hard HEAD
  • 15.
    Sharing and UpdatingProjects ❏ FETCH: To download objects and refs from the repository git fetch -a ❏ PULL: Fetch from and integrate with another repository or a local branch git pull origin <branchname> ❏ PUSH: Update remote refs along with associated objects git push origin <branch> ❏ REMOTE: Manage set of tracked repositories git remote ❏ SUBMODULE: Initialize, update or inspect submodules git submodule add https://github.com/chaconinc/DbConnector
  • 16.
    Inspection & Comparison ❏SHOW: To Show various types of objects git show ❏ LOG: Fetch from and integrate with another repository or a local branch git log ❏ DIFF: Show changes between commits, commit and working tree, etc git diff ❏ DIFFTOOL: Show changes using common diff tools git difftool ❏ SHORTLOG: Summarize git log output git shortlog
  • 17.
    Visual Studio GitFeatures ❏ Show details in Demo
  • 18.
    Be a professional,care about your code Thank You!

Editor's Notes