6. Clone front end
6.1. Start new Glitch project
Let’s “clone” our front end repository on GitHub to a new Glitch project.
- Open Glitch in a new tab, and keep this tab open
- Click the New Project button near the top right
- Then click the Hello-Webpage option to create a new project
6.2. Open Glitch’s command line
Let’s use Glitch’s command line feature (or “console”) to fully clone our front end code from GitHub.
- Click the Tools button in bottom left corner
- Click Logs button in Tools menu
- Click Console button in Logs interface
6.3. Manually clone the front end repository
Copy and paste each of the following comands into the Glitch console to replace the default Glitch project files with our front end files.
*Pro tip: triple-click each line of code to easiliy highlight it for copying!
- Move up one directory to the home directory
cd /
- Remove all visible files in the app directory
rm -rf /app/*
- Remove all hidden files in the app directory
rm -rf /app/.*
- Clone your front end repository (replace USERNAME with your GitHub username)
git clone https://github.com/USERNAME/modern-web-front-end.git app
- Move into the app directory
cd app
- Refresh the glitch web editor to see the new files
refresh
6.4. Checkout branch 1
Our front end project is currently in its finished state. Let’s “checkout” an earlier state to start from the beginning.
Copy and paste the following commands in the Glitch console:
- Checkout branch 1
git checkout 1
- Refresh the Glitch file system to see branch 1
refresh