Git
This is a reference list of the most commonly used Git commands. (You might consider bookmarking this handy page.) Try to familiarize yourself with the commands so that you can eventually remember them all:
- Commands related to a remote repository:
git clone git@github.com:USER-NAME/REPOSITORY-NAME.git
git push
orgit push origin main
(Both accomplish the same goal in some contexts)
- Commands related to the workflow:
git add .
git commit -m "A message describing what you have done to make this snapshot different"
- Commands related to checking status or log history
git status
git log
The basic Git syntax is program | action | destination
.
For example,
git add .
is read asgit | add | .
, where the period represents everything in the current directory;git commit -m "message"
is read asgit | commit -m | "message"
; andgit status
is read asgit | status | (no destination)
.