Skip to content

Workshop Part 1

ABG edited this page Nov 17, 2022 · 7 revisions

Workshop Part 1

Workshop attendees will be provided support for the initial set up of the development environment during Part I of the Workshop. You will need the following to get started:

  • a public GitHub account with two-factor authentication (2FA) setting on
  • A text editor. VS Code is recommended, but feel free to use a text editor of your choice.

Setting up the development environment

1.1 Dev setup (1): Join the repository team

  1. Make your own Hack for LA GitHub organization membership public by following this guide.
  2. Set up two-factor authentication on your account by following this guide.

1.2 Dev setup (2): Installing Git

Before cloning your forked repository to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system here.

For Windows, you may want to install a Windows Subsystem for Linux (WSL) and then install Git from WSL.

Please note that if you have a Mac the page offers several options (see other option, if you need to conserve hard drive space) including:

  • an “easiest” option (this version is fine for use at hackforla): This option would take just over 4GB.
  • a “more up to date” option (not required but optional if you want it): This option prompts you to go to install an 8GB package manager called Homebrew.
  • Other option: If your computer is low on space, you can use this tutorial to install XCode Command Tools and a lighter version of Homebrew and then install Git using this command: $ brew install git which in total only uses 300MB.

1.3 Dev setup (3): Fork the repository

You can fork the hackforla/peopledepot repository by clicking Fork . A fork is a copy of the repository that will be placed on your GitHub account.

Note: It should create a URL that looks like the following -> https://github.com/<your_GitHub_user_name>/peopledepot.

For example -> https://github.com/octocat/peopledepot.

Be Aware: What you have created is a forked copy in a remote version on GitHub. It is not yet on your local machine yet.

1.4 Dev setup (4): Clone (Create) a copy on your computer

Before creating a copy to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system here.

The following steps will clone (create) a local copy of the forked repository on your computer.

1.4.a Clone repo (1): Create hackforla folder

Create a new folder in your computer that will contain hackforla projects.

In your command line interface (Terminal, Git Bash, Powershell), move to where you want your new folder to be placed and create a new folder in your computer that will contain hackforla projects. After that, navigate into the folder(directory) you just created.

For example:

mkdir hackforla
cd hackforla

and run the following commands:

git clone https://github.com/<your_GitHub_user_name>/peopledepot.git

For example if your GitHub username was octocat:

git clone https://github.com/octocat/peopledepot.git

You should now have a new folder in your hackforla folder called peopledepot. Verify this by changing into the new directory:

cd peopledepot

1.4.b Clone repo (2): Verify origin remote url

Verify that your local cloned repository is pointing to the correct origin URL (that is, the forked repo on your own Github account):

git remote -v

You should see fetch and push URLs with links to your forked repository under your account (i.e. https://github.com/<your_GitHub_user_name>/peopledepot.git). You are all set to make working changes to the website on your local machine.

However, we still need a way to keep our local repo up to date with the deployed website. To do so, you must add an upstream remote to incorporate changes made while you are working on your local repo. Run the following to add an upstream remote URL & update your local repo with recent changes to the hackforla version:

git remote add upstream https://github.com/hackforla/peopledepot.git
git fetch upstream

After adding the upstream remote, you should now see it if you again run git remote -v :

origin  https://github.com/<your_GitHub_user_name>/peopledepot.git (fetch)
origin  https://github.com/<your_GitHub_user_name>/peopledepot.git (push)
upstream        https://github.com/hackforla/peopledepot.git (fetch)
upstream        https://github.com/hackforla/peopledepot.git (push)

1.5 Dev setup (5): Set up Docker

Install or make sure [docker][docker-install] and [docker-compose][docker-compose-install] are installed on your computer

    docker -v
    docker-compose -v

The recommended installation method for your operating system can be found here. Feel free to reach out in the Hack for LA Slack channel if you have trouble installing docker on your system

More on using Docker and the concepts of containerization:

Clone this wiki locally