# Setting up your repository & project

### 1. Create a repository for your project on Github&#x20;

Login to your Github account -> go to **Repositories** and click on **New** to create a new repository

<figure><img src="/files/kBJVk2rsv4zq4GXUmKRx" alt=""><figcaption></figcaption></figure>

Fill in **Repository Name** -> **Description (optional)** -> make it **Public** or **Private** -> Click on **Create** **repository**

### 2. Create a repository for your project on your computer

#### 1. Create a new folder&#x20;

If you have previously created a new directory/folder for the project, there is no need to create it again. First, let’s create a new directory in the `Desktop` folder for our work and then change the current working directory to the newly created one. Open Terminal or command prompt:

```sh
$ cd ~/Desktop
$ mkdir project
$ cd project
```

#### 2. Git setup&#x20;

{% code lineNumbers="true" %}

```sh
$ echo "# project" >> README.md # this line creates a readmefile with content
$ git init                      # creates a repo on your laptop in the projects folder
$ git status                    # shows the status of a repository
$ git add README.md             # puts files in the staging 
$ git commit -m "first commit"  # saves the staged content as a new commit in the local repository
$ git branch -M main            # this renames the default branch from "master" to "main"
$ git remote add origin <your github project url> # This adds a new remote repository called "origin" to the Git repository
$ git push -u origin main       # This pushes the changes in the local repository to the remote repository on the "main" branch
```

{% endcode %}

Files can be stored in a **project’s working directory** (which users see), **the staging area** (where the next commit is being built up) and the **local repository** (where commits are permanently recorded), and then can be pushed to the **remote repository**. The diagram below provides the best representation of these.

<img src="/files/jVc3PElxOCIiPgkf65x4" alt="Git workflow by Author" class="gitbook-drawing">

### 3. Remove existing local repository&#x20;

If you wish to remove existing repository and re-do the process from step 1 onwards:

```sh
$ rm -fr .git
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://data-to-production.gitbook.io/product-docs/fundamentals/getting-started/step-1-github/working-with-git-and-github/setting-up-your-repository-and-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
