reading-notes

Revisions and the Cloud

Version Control

Version Control is a system that lets you save and revisit different versions of a file or project. A Version Control System (VCS) helps you go back to earlier versions, see what changed, who changed it, compare updates, and fix mistakes easily.


Cloning

Cloning in Git means making a copy of an existing Git repository from a server. You do this using the git clone command and the repository’s URL.

When you clone a repo:

Example command:


Commands to track and stage files

The linux command used to track and stage files is git add.

To stage a single file:

To stage all files:


Take a snapshot of your changed files

Saving your changes in Git is called a commit, and Git creates a snapshot of your project when you commit.

Commit staged changes with a message:

Example with details:

Commit all modified tracked files:


Sending changed files to Github

To send your changes to a remote repository, referred to as “pushing changes”, use:

This pushes your changes from the local master branch to the remote repository named origin. When you clone a repo, Git automatically names the original server origin.