⌘ + Shift + 4
// # takes you to 4th screen
⌘ + w
// close window
⌘ + l
// takes you to browser url address
⌘ + t
// new tab
⌘ + option + arrow
// go between tabs
⌘ + n
//open a new window
⌘ + Shift + n
// open a new window in Incognito mode
// open a new tab, and jump to it
⌘ + Option + Right
//jump to the next open tab
⌘ + Option + left
// jump to the previous open tab
⌘ + 1 through ⌘ + 8
// jump to a specific tab
// closes the current tab or pop-up
⌘ + m
// minimize the window
⌘ + q
// quit program
Shift + command + p
// SHORTCUT KEY FINDER
Command + /
// comments out all selected lines
Option + z
//selected toggles code word wrap
Shift + Option + F
// automatically indents all of your code
Command + l
// selects entire line of code
Option + arrow
// moves code line up or down
Option + shift + arrow
// copies line of code and moves up/down
Control + tab
// cycle through tabs within window
Select word + Command + left click
// takes you to section where that function is defined
In PyCharm…select code...refactor...rename
// rename all variables at once
Right click on function
// get function definition
print("the error is " + str(error))
$ ls
// lists out files and folders in your current directory
$ pwd
// print working directory (i.e. current folder)
$ cd Dropbox
//changes directory to dropbox…
$ cd ..
// Takes you up one folder to the parent directory
$ cd
// Takes you back to your home directory…
$ cd first letter, then tab
//type cd, space, first letter of folder, tab autocompletes, then first letter of next folder, then tab…
$ control + c
//shut down server; cancel / quit
Up arrow
//scroll through previous commands
$ history
// history of previous commands
$ clear
// clears history
Command+shift+d
// opens up new CLI
Command+w
// close windows
Ctrl+r
//searches previously typed code
$ code /backend/main.py
// opens up a vile in VS code
$ printenv
// print environment variables
$ cp SOURCE DESTINATION
// copies a file from source to the destination
$ export USERNAME=picasso
// sets env variable USERNAME to picasso
$ echo $ USERNAME
// prints out env variable e.g., picasso
$ mkdir
// create a folder or directory FOLDER_NAME
$ touch FILE_NAME
// create new file
$ python3 myapp.py
// Run a normal python file (make sure to first navigate to the file where the program sits on your CLI)
$ FLASK_APP=app.py flask run
// Run a flask app defined at app.py
$ FLASK_APP=app.py FLASK_DEBUG=true flask run
//To enable live reload, use the following
$ git clone https://github.com/myUserName/repoName
$ git init
$ git add .
$ git commit -m 'initial project version'
$ git remote add origin2 https://github.com/myUserName/repoName
$ git remote -v
$ git push origin2 master
$ code test_repo.py
$ git status
$ git commit -m "test commit 1"
$ heroku git:clone -a uprise-u
$ git fetch origin
$ git pull
$ git log
$ git checkout -b oldStateName d919509
$ git commit -m "third commit based on oldStateName branch"
$ git push origin oldStateName
$ git checkout master
$ git checkout oldStateName
$ git merge oldStateName
$ git config -list
// describes which remote origin you are pointed towards
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
// lets you change your username and password that you are required for you to post and write and pull from GitHub
$ git help fetch
// brings up help manual for fetch or any other verb
$ man git-VERB
$ git diff
// lets you view your staged and unstaged changes
$ git log --oneline --decorate --graph --all
print out history of your commits, showing where your branch pointers are and how your history has diverged
$git log --oneline --decorate
can easily see this by running a simple git log command that shows you where the branch pointers are pointing
$ git branch
// If you run it with no arguments, you get a simple listing of your current branches. * character that prefixes the master branch indicates the branch that you currently have checked out (i.e., the branch that HEAD points to)
$ git branch -v
// shows last commit on each branch
$ git branch -D BRANCHNUMBER
You can delete branches that you no longer use
$ git reset -hard
deletes all changes since last commit