reading-notes

Git Intro

Source: Git Tutorial: A Comprehensive Guide

Notes

What is Git?

Snapshots

Local Operations

Track Changes

Loss of Data

States

Life Cycle of a File

Basic Git Commands

$ git status
$ git add filename (for a single file)
$ git add * (for all files in a repository)
$ git add . (for all files in a directory)
$ git commit -m "comments on change" (this commits the current file)
$ git commit -a (commits all changes made to tracked files)
$ git push origin master (will push to the master branch on repository on GitHub)
$ git stash (temporarily removes changes and hides them, giving you a clean working directory)

$ git stash apply (retrieves hidden changes)

Remote Repositories

$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
(this will make a local copy of your Git repository)