# Getting Started

## Git and GitHub

To work with the website, make sure to have a [GitHub](https://github.com) account and [Git ](https://git-scm.com/)installed.

### Cloning and Pushing

Clone the repository to your local machine by running:

```bash
git clone https://github.com/HackAtUCI/irvinehacks-site-2024.git
```

When pushing to the repository, the following may occur:

* **Your changes are pushed properly and appear on GitHub:** no further setup needs to be done!
* **Git prompts you for a username and password:** you can supply your GitHub username for the username and a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for the password.
  * You can also [set up an SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent), use the[ GitHub command line interface](https://cli.github.com/), or use [GitHub Desktop](https://desktop.github.com/) to link your GitHub account to your computer and allow you to push to the repository.

### Branches

When the team is working on their own issues or new features, we each create separate branches so that one person's work does not conflict with another's. &#x20;

<figure><img src="https://3909220394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4KIsLjSBshSrtVh5jKQl%2Fuploads%2Fsp6Mm6gTLI3NQ7ZqOiaa%2Fimage.png?alt=media&#x26;token=de5b2a46-dcbd-41d1-9d4b-58b4223c04e2" alt=""><figcaption><p>To create a new branch, click "create a branch" on the bottom right and enter a branch name.</p></figcaption></figure>

At Hack at UCI, we tend to name our branches by stating the type of change, followed by a forward slash, and then the name of the change itself. For example, the above issue could have a branch name of `setup/pre-commit-hooks` because this issue is related to setting up the development environment and pre-commit hooks is the topic of the issue.

### Pull Requests

A pull request facilitates the merge of a branch dedicated to resolving an issue into the `main` production branch. It allows other team members to review the code in the branch and provide feedback on any changes.

<figure><img src="https://3909220394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4KIsLjSBshSrtVh5jKQl%2Fuploads%2FGypYM5LSbiZUQcTkUObE%2Fimage.png?alt=media&#x26;token=f09ab729-7bc2-4af7-ae2c-a455b27657a7" alt=""><figcaption><p>An example of a comment on a pull request related to the administration portal</p></figcaption></figure>

The tech team has added automated feedback for code formatting and issues with types, along with a preview deployment system, so developers can look at the changes in the branch as if they were already deployed to production. We deploy these previews to [Vercel](https://vercel.com/), which you can read more about in [preview-and-production-deployments](https://hack-at-uci-tech-team.gitbook.io/irvinehacks-2024-website-docs/preview-and-production-deployments "mention").

<figure><img src="https://3909220394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4KIsLjSBshSrtVh5jKQl%2Fuploads%2FVdQrSeZsms97bOSsIelq%2Fimage.png?alt=media&#x26;token=38f3b2de-8645-4b3c-acb9-8c28f25eb938" alt=""><figcaption><p>An example of the preview deployment at work</p></figcaption></figure>

{% hint style="info" %}
One thing to keep in mind when creating issues is to avoid making large scope issues. Otherwise, a pull request for a branch to resolve this issue can become unnecessarily large due to both automated comments and comments from other developers on the team.

For example, a task for creating new page should not be allocated only one issue, but rather split into several smaller issues, unless the page is small enough.

You can create a [task list](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists) to keep track of the changes related to the page.
{% endhint %}
