Version Control: a system that allows you to revisit various versions of a file by recording changes. This allows you to revert a file/project to a previous version, track modifications, see who made those changes, and compare changes. Using a Version Control System (VCS) mistakes or deleted information is easily fixed and collaboration between multiple people is simplified.
Snapshots: Git is a DVCS that stores data in a file system made up of snapshots. Each time you save a new version of a project (aka a commit) Git makes a snapshot of this file and references it for future use.
States: Files in Git can exist in three (3) main states.
Pop Quiz: Do you remember exponents?
Git’s history begins with an open source software project called Linux kernel. Project developers started using a DVCS called BitKeeper in 2002, but in 2005 this stopped due to personal tensions. Following this, Linus Torvalds (chief developer of Linux kernel) started making Git. Since its development, Git has become one of the most utilized Version Control Systems in the world with millions of users.
A copy of an existing Git repository can be cloned down to a computer server using the clone command with a repository’s URL:
git clone [Git repository URl]
git status
We need to ‘ACP’ our changes: Add, Commit, Push!
git add [file name]
git add file1 file2
git commit -m “Message goes here”
git commit -a
git push origin main
Exclamation marks will break code unless needed for a specific function.
git pull origin main
If changes are not properly consolidated between GitHub and VSCode then the request will break
3 Ways to Fix “Git”uations:
git config pull.rebase false
git config pull.rebase true
git config pull.ff only