1 / 13

Git Basics

Git Basics. Git stores data as snapshots of the project over time. When commit Save all the files If files have not changed, point to the previous identical file To be more efficient Create a ID to reference the commit ID=SHA1. Other SCM systems.

knox-howard
Download Presentation

Git Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GitBasics

  2. Git stores data as snapshots of the project over time • When commit • Save all the files • If files have not changed, point to the previous identical file • To be more efficient • Create a ID to reference the commit • ID=SHA1

  3. Other SCM systems Other systems tend to store data as changes to a base version of each file.

  4. Initializing a Repository in an Existing Directory • Create a folder • Inside the folder • $ gitinit

  5. .git Folder • Init command creates .git folder • Local repository • Invisible folder • To display invisible folders $ ls -la

  6. Inside .git folder $ ls–l .git

  7. Your Identity • Keep tracking of who worked on the code • Name • Email • Example $ gitconfig --global user.name "John Doe" $ gitconfig --global user.emailjohndoe@example.com • Identify is save in .gitconfig • Under the home foler

  8. Cat .gitconfig • Show the configuration information

  9. Adding and Committing

  10. Staging Area Before and after git add

  11. Recover files from .git • You can recover them from .git (local repository) • After deleting files from working directory

More Related