Table of Contents
UNIX
REPOSITORIES
BACKEND HOSTING
FRAMEWORKS
print working directory; current directory you are in the file system
/Users/<user directory>/Documentsmanual for for terminal commands;
man rm
man ls
man gitlist all files and directories in current working directory
Documents Desktop Downloadsls -a - flag to see all, including hidden
.gitconfig .gitignore .vscode
Documents Desktop Downloadsls -l - flag for more detailed information
total 0
drwx------@ 7 <user directory> staff 224 Jun 29 23:52 Desktop
drwx------@ 13 <user directory> staff 416 Jun 30 01:47 Documents
drwx------+ 6 <user directory> staff 192 Jun 29 11:40 Downloads
drwx------@ 74 <user directory> staff 2368 Jun 15 21:40 Library
drwx------ 5 <user directory> staff 160 Jun 2 09:05 Movies
drwx------+ 5 <user directory> staff 160 Jun 2 09:05 Music
drwx------+ 4 <user directory> staff 128 Apr 2 17:12 Pictures
drwxr-xr-x+ 5 <user directory> staff 160 May 24 11:07 Public
drwxr-xr-x 4 <user directory> staff 128 Jun 2 09:05 VirtualBox VMs
drwxr-xr-x 10 <user directory> staff 320 Jun 30 06:29 seichange directory
cd Documents
cd /home/Desktop
cd Downloadscd . - represents the current directory; all part of the directory
cd ./Documents
cd ./Desktop
cd ./Downloadscd .. - represents the parent directory; moving up one in the directories
cd .. cd ~ - home directory of current user; /Users/
cd ~make directory
mkdir myDirectory
mkdir projects
mkdir users-working-branchremove directory
rmdir myDirectory
rmdir projects
rmdir users-working-branchcreates files in a directory
touch index.html style.css contacts.jsremoves files from current directory; use the -r flag to delete folders; use -f flag to force remove something
rm index.html
rm -r myDirectory
rm -f users-working-branch
rm -rf this-working-directorymove files
mv filename [/new/location/new-filename]copy; use the -r flag to copy folders
cp filename [/location/of/new-filename] Basic commands
git init- initializes a repository on terminalgit clone- makes a local copy of a fork: git clone https://url-to-clonegit status- gives status of repositorygit add- stages files for committing /// git add index.htmlgit commit- git commit -m "created a new post.txt file"git reset- undoes a staged commitgit push + [a] + [b][a] originis a shortcut for the URL of your default remote repository (in this case, the repository on GitHub). You can have many remotes if you want, but we’re only going to work with one for now.[b] masterrefers to the branch on your remote repository where you are currently adding your changes. Again, for now, we’re just going to be working on the master branch.git log- shows a time line of changes and who make the entries
commit 6d33f525a09b9918f75188db164ea2722039830b
Author: Sarah <[email protected]>
Date: Wed Jan 28 17:44:03 2015 -0500
added a new postBest practices
`git branch` - confirm your working on the right branch
`git status` - (to confirm a clean working directory)
`git add [fileName]`
`git status` - (to confirm modified files have been staged)
`git commit -m "If applied, this commit will ..."`
`git log` - (to verify your last commit worked)commit message template
A properly formed Git commit subject line should always be able to complete the following sentence:
If applied, this commit will ...
If applied, this commit will refactor subsystem X for readability
If applied, this commit will update getting started documentation
If applied, this commit will remove deprecated methods
If applied, this commit will release version 1.0.0
If applied, this commit will merge pull request #123 from user/branchWorking with other repos
The workflow for contributing to an open-source product or your dev team’s project comprises the following steps:
1. Forking
2. Cloning
3. Editing
4. Adding/committing
5. Pushing
6. Submitting a pull requestHeroku Command Reference
A full list of Heroku commands can be accessed by running heroku --help; below are some of the more common ones.
| Commands | Behavior |
|---|---|
| heroku logs [--tail] | Running just heroku logs will show you the server logs from your deployed API. The --tail flag is optional. |
| heroku run ... | Run a program from within Heroku. Examples (heroku run rails console, heroku run rails db:migrate). |
| heroku config | Environmental variables in your current Heroku app. |
| heroku config:set CLIENT_ORIGIN=https://yourgithubname.github.io | Set CLIENT_ORIGIN |
| heroku apps:rename newname | Rename Heroku app name (entirely optional). |
| heroku restart | Restart the Heroku app, make sure you do this after changing your API. |
| heroku Open | Open your Heroku app in default browser. |
Django Command Reference
| Commands | Behavior |
|---|---|
python -m pip install Django |
installs Django package |
pip install Django==<version> |
installs Django package with the specified version ( ex. Django==3.0) |
pipenv shell |
starts the Django development environment |
| Commands | Behavior |
|---|---|
django-admin startproject bigredproject . |
Generate a project folder named bigredproject in current directory which is specified by the . at the end of the folder name |
django-admin startapp api |
Generates an app folder named api |
| Commands | Behavior |
|---|---|
python manage.py shell |
Start up the pipenv shell virtual environment |
python manage.py runserver |
Run the Django server |
| Commands | Behavior |
|---|---|
python manage.py showmigrations |
Shows existing migration files |
python manage.py makemigrations |
Generate new migration files |
python manage.py migrate |
migrates the files |
python manage.py migrate <app_name> zero |
"Rollback" or undo ALL migrations |
python manage.py migrate 0002 |
"Rollback" or undo specific migrations |
command to change from zsh to bash terminal
chsh -s /bin/bashpaths
absolute paths : /Users/hernandohernandez/Destop
relative paths : ./../DesktopToggle between apps
command + tabSpotlight search
command + spaceTab backwards
shift + tab