Git & GitHub#

Git is a popular version control system for developers to manage and collaborate on code. It runs on the command line or Anaconda Prompt.

Terms:

Term

Description

git

A command line program used to track file changes and collaborate on code with others.

repo

A repository is a directory and its contents.

local repo

A directory and its contents on your computer that git knows about.

remote repo

A directory and its contents stored in the cloud that git knows about.

Options:

Command

Description

git clone https://github.com/user/repo.git

Copy a remote repo from GitHub.com into a local directory.

git init

Create a new local repo in the current folder.

git remote add origin https://github.com/user/repo.git

Link a local repo to a remote repo on GitHub.com.

git add .

Add all files and changes to the local repo.

git commit -m "commit message"

Commit the changes in the local repo with the message “commit message”.

git push origin master

Push local changes up to the remote repo.

git pull origin master

Pull down the version in the remote repo into the local repo.