# Getting started!

### Overview

Let's start with an overview of what we are trying to achieve.

Let's check how [the landingpage of GitLangind itself](https://www.gitlanding.dev/) is setup.

The code of the website lies on a [dedicated branch](https://github.com/thieryw/gitlanding/tree/4e5a33ed312227efcf7d26332ea87c19331f1eed) of the [GitLanding repo](https://github.com/thieryw/gitlanding/tree/2105d99c84b76f6c6b0647484171c5e09a61dbf5). The files that are actualy served by [GitHub Page](https://pages.github.com/) lies on the [`gh_pages`](https://github.com/thieryw/gitlanding/tree/b11d5dab0df08a84b7acc72a25d0c3fa7c78cc6b) branch and is put there using [this GitHub Action](https://github.com/thieryw/gitlanding/blob/eb85ca1fea7ce0ce21837d1e0ba7a6bb1a784b19/.github/workflows/deploy.yml#L21).

### Step by step guide

{% tabs %}
{% tab title="MacOS" %}
Open a new terminal (for example [iTerm2](https://iterm2.com) )

```bash
# Only if you don't have yarn already 
# (you need https://brew.sh to run the next command)
brew install yarn

#
git clone https://github.com/<user_name>/<project_name> <project_name>_landingpage 
cd <project_name>_landingpage

git checkout --orphan landingpage && git rm -rf .
yarn create react-app . --template gitlanding

git add -A
git commit -m "Initial commit"
git push --set-upstream origin landingpage
```

{% endtab %}

{% tab title="Windows" %}
If you don't have it already, [install Node.js](https://nodejs.org/en/).

Open a Powershell terminal

```bash
git clone https://github.com/<user_name>/<project_name> <project_name>_landingpage 
cd <project_name>_landingpage

git checkout --orphan landingpage
git rm -rf .
yarn create react-app . --template gitlanding

git add -A
git commit -m "Initial commit"
git push --set-upstream origin landingpage
```

{% endtab %}

{% tab title="Ubuntu/Debian" %}
If you don't have [the yarn package manager](https://classic.yarnpkg.com/lang/en/) installed allready:

```bash
# Using Ubuntu
sudo su
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
# Using Debian
su root
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
####
apt-get install -y nodejs
npm install -g yarn
```

Open a new terminal

```bash
git clone https://github.com/<user_name>/<project_name> <project_name>_landingpage  
cd <project_name>_landingpage

git checkout --orphan landingpage && git rm -rf .
# If you get: 'yarn: error: no such option: --template' running the following command. It means you have 'yarn' from cmdtest, we need yarn the package manager.
yarn create react-app . --template gitlanding

git add -A
git commit -m "Initial commit"
git push --set-upstream origin landingpage
```

{% endtab %}
{% endtabs %}

Next you'll have to enable GitHub page in your repo. Navigate to your repository on Github and go to `Setting > Pages`, then set the `gh-pages` branch as the branch from witch the site is to be built.

{% hint style="info" %}
You may need to wait a few minutes for the initial gh-pages branche to be created by your GitHub Action workflow `.github/workflows/deploy.yaml`
{% endhint %}

![https://github.com/USERNAME/REPO/settings/pages](https://2656780871-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_GXNChb3BtKFYeBQbX%2F-Ml0rAQrYxYRIyWF0loL%2F-Ml0vxj7s4Q6riv2xQrN%2Fgh-page-screenshot.png?alt=media\&token=cd5bfc4d-ee0c-4948-96a5-fc87beaf021d)

If all went as expected you page should be up and running

![](https://2656780871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP0LOW1foeotTNnpP02OZ%2Fuploads%2FkgfYsY9UzOB2xdwi2DNV%2FScreenshot%202022-07-16%20at%2015.15.53.png?alt=media\&token=bc847af9-b580-47a2-ab45-1cd458e7145b)

You're now ready to customise your app.
