Git terms and commands
getting to know the git lingo
Common Git terms
Term | Laymen's term |
---|---|
repository (aka repo) | project folder |
local repository (aka local) | project folder on a personal computer |
remote repository (aka remote) | project folder on the Internet (a server, perhaps?) |
staging | a selection of files from the project folder |
committing | confirming the selection of files as a change to the project |
pushing | uploading the confirmations to the project folder on the Internet |
cloning | copying a project folder from the Internet to one's computer |
forking | copying someone else's project from the Internet onto one's own account |
branching | creating a parallel version of a project (which can later merge back) |
checkout | setting a branch as the current working branch |
merging | combining a version with another version of a project |
Common Git commands
Type git
plus any of the following:
Command | What it does |
---|---|
| **creates **or initializes a new local repository |
| adds all the changes to the Git repository to "staging" |
| updates the local repository with all the changes previously added to "staging" (tagged with a message summarizing the changes made) |
| connects the local repository with a remote repository (usually on GitHub.com) |
| uploads the most recently committed changes (from the local repository to the remote repository) |
| downloads a remote repository to one's own computer |
| switches to a branch in the local repository (assuming it exists) |
| creates a new branch in the local repository |
| displays a list of all branches |
| displays the current status of the local repository, i.e.:
|
| retrieves the latest changes of a working version from the remote to the local |
| displays a list of code changes since the last |
Typical workflow
Last updated