Get Git Cheatsheet
Git Command Quick Ref
Command | Description |
---|---|
git config --global |
Set up Git with your information, usually only the first time you use a computer |
git clone URL |
Copy a remote repo to your local machine, get the URL from GitHub. |
git pull |
Download new changes from the remote repo |
git status |
Check the status, use often! |
git add FILENAME |
Add “FILENAME” to the “staging area” |
git add -A |
Add all the changed files to the “staging area” |
git commit -m "message" |
Take a “snapshot” |
git push |
Upload commits to the remote repo |
git log |
Review the repo history |
git diff |
Compare differences between current files and history |
Command Line Navigation
Command | Description |
---|---|
pwd |
“print working directory”, tells you where you are. On Git Bash, use pwd -W to print the Windows style file path. |
ls |
Lists the files and folders in your current location |
ls -a |
List all, including hidden directories |
cd |
“change directory”, move to a new folder. Note: on Git Bash you can get to the main Windows file system at using cd /c/ , i.e. /c/ = C:/ . |
cd .. |
back one level |
cd ~ |
switch to “Home” directory |
mkdir FOLDER |
“make directory”, create a new directory called “FOLDER” |