Git Flashcards
Working directory / tree
The project directory associated with (containing) the local repository
Staging area / index
A file in your local repository containing the changes to the working directory that will go into the next commit
Local repository
A directory containing a snapshot and metadata for each of your commits; .git
Remote repository
A repository hosted on a network (internet)
Git init
Initializes an empty Git repository
Git add
Adds selected files to the staging area
Git status
Shows files that are:
- Untracked
- Modified but unstaged
- Staged but uncommited
Git commit
Creates a new commit (snapshot) with the files in the staging area
Git diff
Shows the differences between two objects (commits, files, trees, indices, etc)
Git log
Shows a list of all commits made to a repository
Git push
Updates the remote repository with the new commits from the local repository
Git fetch
Downloads the remote repository without updating the local repository; used to see what changes have been made since your last fetch or pull
Git merge
Joins two or more development histories (branches) together; used for merging new features into the main branch
Git pull
Fetches content from a remote repository and merges it with your local branch; a combination of fetch and merge
Git branch
Creates a new branch