Top Banner
42

Git basics

Apr 15, 2017

Download

Technology

Vijay Naik
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Git basics
Page 2: Git basics

Overview

• What is Version Control System?• Why should we care for VCS?• What is git?• git Architecture• What is Source Tree?• Working with git using Source Tree• Working with git using Commands• Hands-on

Page 3: Git basics

What is Version Control System?

• A File Management System• Records changes to a file or set of files over time• Changes recorded at a specific time is called as a

“Version” or “Snapshot”

Page 4: Git basics

What type of files?

• Any type of file on your computerText FilesVideoAudioImagesPDFs

Page 5: Git basics

Why should we care?!

• We are dealing with files every day!!

• Revert files back to a previous state• Revert the entire project back to previous state• Compare changes over time• Find who messed up!

Page 6: Git basics

Why should we care?!

“If you screw things up or lose files, you can easily recover”

Page 7: Git basics

What is git?

• One of the many version control systems

Page 8: Git basics

git Architecture?

Page 9: Git basics

git Architecture?

• Working Directory:Accessible to usersModify FilesAdd FilesDelete Files

Page 10: Git basics

git Architecture?

• Staging Area:Temporary storageContains files which are ready to be recorded by gitFiles are moved here before they are recorded

Page 11: Git basics

git Architecture?

• git Repository:Keeps snapshot of recorded filesOnes files reach here, they are safeVersions at the time of commit are stored hereContains multiple different versions of a file

Page 12: Git basics

What does working with git mean?

Page 13: Git basics

And, how do we do that?

• Commands• UI Clients

Page 14: Git basics

What is Source Tree?

• A UI based git desktop clientGood UIHas almost all functions of gitEasy to use

Page 15: Git basics

Working with git & Source Tree

Page 16: Git basics

gityfying a floder

Page 17: Git basics

New file in Working Directory

Page 18: Git basics

Adding file to Staging Area

Page 19: Git basics

Removing Staged file

Page 20: Git basics

Adding file to Staging Area

Page 21: Git basics

Modifying a Staged File

Page 22: Git basics

Adding file to Staging Area

Page 23: Git basics

Committing to git Repo

Page 24: Git basics

Modifying a committed file

Page 25: Git basics

Staging the File

Page 26: Git basics

Committing to git Repo

Page 27: Git basics

Reverting Back

Page 28: Git basics

git & Command Line

Page 29: Git basics

gityfying a floder(git init)

Page 30: Git basics

New file in Working Directory(git status)

Page 31: Git basics

Adding file to Staging Area(git add “File Name”)

Page 32: Git basics

Removing Staged file(git reset “File Name”)

Page 33: Git basics

Adding file to Staging Area(git add “File Name”)

Page 34: Git basics

Modifying a Staged File(git status)

Page 35: Git basics

Adding file to Staging Area(git add “File Name”)

Page 36: Git basics

Committing to git Repo(git commit –m “message”)

Page 37: Git basics

Modifying a committed file(git status)

Page 38: Git basics

Staging the File(git add “File Name”)

Page 39: Git basics

Committing to git Repo(git commit –m “message”)

Page 40: Git basics

Reverting Back(git checkout “commit” “File Name”)

Page 41: Git basics

Questions??

Page 42: Git basics

Hands-on!!