Upload
curtis-butler
View
248
Download
0
Embed Size (px)
Citation preview
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
Other systems tend to store data as changes to a base version of each file.
Initializing a Repository in an Existing Directory
• Create a folder• Inside the folder• $ git init
.git Folder
• Init command creates .git folder
• Local repository• Invisible folder• To display
invisible folders $ ls -la
Inside .git folder
$ ls –l .git
Your Identity• Keep tracking of who worked
on the code• Name• Email• Example
$ git config --global user.name "John Doe" $ git config --global user.email [email protected]
• Identify is save in .gitconfig– Under the home foler
Cat .gitconfig
• Show the configuration information
Adding and Committing
Staging Area
Before and after git add
Recover files from .git
• You can recover them from .git (local repository)
• After deleting files from working directory