Git
Authors: Daniel Cui, Ryan KimWhat is Git?
Git is a version control system that tracks and manages the changes made to computer files throughout development, commonly used in software projects for collaboration, coordinating work, and maintaining a history of the source code.

Installing
Install Git from here. It may already be installed if you are using Mac or Linux.
If using Windows, install it with the installer.
- You can go with most of the defaults in the setup, but you look into some of the other options. This step-by-step guide works if you are just starting out.
- After installing, make sure you are using the Git Bash as your terminal (instead of the command prompt) or you have Git added to your PATH.
If using Mac,
homebrewis a great way to install packages like Git.If using Linux, you can use the preferred package manager for installing, like
aptfor Debian orpacmanfor Arch.- but seriously if you are using Linux, you already know this, don’t you?
You can also use a GUI like GitHub Desktop along with Git instead of a CLI, but I suggest against it. Learning to use the CLI is pretty important.
How It Works
A Git repository is simply just a directory on your computer where you tell it to track files with git init.
When you add files in the directory, they are untracked. You can add them to the staging area with git add,
and once you’ve made enough changes for a commit, you can write a snapshot of the current state of the directory
to the commit history with git commit.
Often, git repos are stored in a remote location like on GitHub, where you can git push
your own commits to and git pull changes that other collaborators have made.

Before making any commits, you will need to run the following commands in the terminal to set your Git config. This sets the metadata about the author for all commits.
git config --global user.name "<your_name>"
git config --global user.email "<your_email>" A .gitignore file tells Git to not track certain files in the current repository. Useful
in not committing installed packages like node_modules or .venv and outrageously large files.
Git uses a .git hidden directory to track and maintain the repository. If you delete it,
you wipe you commit history, and you will have to re-initialize the directory to use Git.
There’s a lot more to Git like with branching, rebasing, tags, etc., but you should learn the basics first. This is a pretty good video tutorial, and there are many other pretty great resources online.
Common Git Commands
initinitializes a git repository in the current directorystatusprints the status/current state of the Git repositoryaddadds files to the staging areacommitcommits all staged files into a commit in the commit historylogprints the commit historyremotecreates, views, or deletes connections to remote repospull/pushupdates local or remote repostashtemporarily stashes changes in your working directory to reapply laterbranchcreates a new branch in the reposwitchswitches branchesmergemerges branchescheckoutchecks out branches or past commitsrevert/reset/rebasedestructive commands
Note: if you can’t figure it out, just Google it! Also, the docs are here!