# On the command line

You can also directly use the git commands to commit your code

## First you need to have git installed.

You can use scoop to install Git, or directly download Git from <https://git-scm.com/downloads>

## Git initialisaton

Use one of the command terminal, such as Powershell on Windows

Run the following commands

```
git init
git add .
```

## Commit your code to your local repository

```
git commit -m "replace with your own comments"
```

## Create a empty repository on Github

<figure><img src="https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2F7Z63zopXl0smkEZbhqyI%2Fimage.png?alt=media&#x26;token=c36113cb-938b-44ce-ba21-18b6435b33b9" alt=""><figcaption></figcaption></figure>

Create the main branch and push the cod

```
git branch -M main
git remote add origin https://github.com/your_user_name/your_repository_name.git
git push -u origin main
```

<figure><img src="https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2FaTjMyhDYZ2TnyWNuWsJa%2Fimage.png?alt=media&#x26;token=d7b17f00-8dc1-4e7e-9cf5-3d86a136cb31" alt=""><figcaption></figcaption></figure>
