EthBuilders Curriculum Support

Table of Contents

Project Contact Info

Join our Slack

Anthony A (Organizer | Developer)

  • Github: @tesla809
  • Slack: @Anthony_Albertorio_NEVER_ASKS_FOR_COIN

Edward Amor (Developer)

Common Commands

Bash Terminal

Show Directory Information

  • pwd - print working directory - show your current absolute directory path

  • ls - list documents in directory

  • ls -a - list ALL including hidden ones (like .gitignore or .env)

  • cd - go directly to computer’s root

  • cd ./ - stay in same directory

  • cd ../ - go up one directory

  • cd ../../ - go up two directories. Note continue to add ../ to go up 1 directory

Manipulate Files

  • touch <FILENAME> - create a new file

  • rm <FILENAME> - remove file. Note: file is immediately deleted and does not go to trash bin

  • mkdir <NAME> - create a new directory

  • mv <FILENAME> <NEW DIRECTORY> - move file to new directory

  • mv <OLD FILENAME> <NEW FILENAME> - rename file

  • rmdir <NAME> - remove an empty directory

  • DO IT VIA GUI to avoid costly mistakes - remove non-empty directory

Display Files

  • cat <FILENAME> - display file in terminal
  • man <COMMAND> - see the command’s manual
  • q - exit program - like man or cat

Git

Git Information

  • git status - Show the working tree status

  • git log- show the current HEAD and its ancestry

  • git log --pretty=format:"%h %s" --graph - show the current HEAD and its ancestry with formatting

  • git reflog- show an ordered list of the commits that HEAD has pointed to (a local undo history for your repo - reference)

  • git branch -a - show all branches

  • git remote -v - list remote repositories

  • git diff- show line-by-line changes in your branch compared to master

Make Changes

  • git checkout -b <branch>- Create new branch to make changes

  • git checkout <branch>- Checkout branch to make changes

  • git mv <old-file> <new-file>- Change file name

  • git rm <file>- Delete file

Commit Changes

  • atom <filename> (or text editor of your choice) - Make changes to the file

  • git add <filename> - Add a single file with changes

  • git add -A - Add all files with changes

  • git commit -m "Commit Message" - Commit the change with a message

  • git commit -am "Commit Message" - Add all files and commit the change in one command

  • git commit --amend - Modify last commit message

  • git push origin - Push change to repository (on Github)

Update the Repo

  • git remote add upstream <clone-link> - Setting an upstream repository

  • git checkout master - Check out the master branch

  • git fetch upstream <branch> - Fetch branch from the upstream repository

  • git rebase upstream/<branch> - Rebase changes from the upstream repository

  • git push origin - Push changes to the origin repository

Delete Branch

  • git push origin -d <branch> - Delete the branch from origin

  • git branch -d <branch> - Delete the branch from local

Yarn | NPM

Full list of yarn commands Full list of npm commands

yarn install
npm i

yarn add <package-name>
npm install <package-name>

yarn remove <package-name>
npm uninstall <package-name>

yarn init
npm init

yarn upgrade <package-name>@<verision>
npm update <package-name>@<verision>

Set Up Instructions

macOS and Linux Setup

The Bash based terminal already comes pre-installed with UNIX based systems like macOS and Linux, so there is nothing to set up.

Windows Setup

TBD

Accesssing Command Line

Via macOS

  1. Hold down Spacebar + Command for Spotlight search
  2. Type Terminal
  3. Enter
  4. Voila!

Place the terminal link where you find best to access.

Via Windows

TBD

Git / Github

Git Resources

⚠️ 👀 WARNING: You should use rebase only for squashing YOUR local commits prior to a pull request. DO NOT ever rebase commits that have already been published to master. This will rewrite our public project’s history. This applies to maintainers of the project.

Github Workflow Resources