# Your first steps with git

## Clone your git repository

### Get the git url

Navigate to your git repository and clone the git url

[![image-1649588364634.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/vTYzPUzD6NCMI0Ge-image-1649588364634.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/vTYzPUzD6NCMI0Ge-image-1649588364634.png)

### Navigate to your workspace

Navigate to your workspace directory.

[![image-1649588539574.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/ypDZjPyXMlxEIVz9-image-1649588539574.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/ypDZjPyXMlxEIVz9-image-1649588539574.png)

### Clone the repository

You can clone the repository by using the git clone command.

```shell
git clone <git url>
# For example:
git clone ssh://git@gitea.voser.cloud:2222/janic/Calculator.git
```

If you are prompted to accept to ssh-fingerprint type yes and hit enter

[![image-1649588683009.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/TrQo0VkSC149YCMq-image-1649588683009.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/TrQo0VkSC149YCMq-image-1649588683009.png)

### Open repository in your editor

Navigate into your repository (`cd "your repository name"` /`cd Calculator` )

Open this directory in VScode with the following command `code .`

[![image-1649588847485.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/8tIzU2LEdYmhWOlB-image-1649588847485.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/8tIzU2LEdYmhWOlB-image-1649588847485.png)

In Visual Studio Code you need to trust the author of this repository.

[![image-1649590514694.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/PhNt9Yaz4U54srFV-image-1649590514694.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/PhNt9Yaz4U54srFV-image-1649590514694.png)

Afterwards you can see the Project folder on the left side. You can press &lt;ctrl&gt;+&lt;b&gt; to toggle this explorer view.

### Edit a file

If you now edit a file you can see which lines you have modified.

[![image-1649590872778.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/5mkCI18s18f45ZBN-image-1649590872778.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/5mkCI18s18f45ZBN-image-1649590872778.png)

1. Click on the file you want to edit.
2. Edit the line, you will see a blue mark in the beginning of the line, if the line was modified.
3. If you safe the file you will see an M on the end of the file, this is a visual indicator that the file got edited.

## GIT Gui VScode

### Changes

[![image-1649591677057.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/urxVO7DXVbhvwNUl-image-1649591677057.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/urxVO7DXVbhvwNUl-image-1649591677057.png)

1. Navigate to the git section of VS-Code
2. Click on the modified file
3. Here you can see the changes

### Add files to commit

[![image-1649591776545.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/dt0UQjBpBtzZIVP1-image-1649591776545.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/dt0UQjBpBtzZIVP1-image-1649591776545.png)

Click on the plus sign of the modified file.

### Commit

[![image-1649591876931.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/mQGC0beGBqmATuQL-image-1649591876931.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/mQGC0beGBqmATuQL-image-1649591876931.png)

1. Every file in the Staged changes gets commited with the same commit comment.
2. Click on Commit to add the changes

[![image-1649591974757.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/6C6CVbgZzs4ISq3N-image-1649591974757.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/6C6CVbgZzs4ISq3N-image-1649591974757.png)

Enter a commit message which describes the changes

[![image-1649592070081.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/n1GkyUWYKQRfF39M-image-1649592070081.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/n1GkyUWYKQRfF39M-image-1649592070081.png)

1. Click on Sync Changes to push the changes to your remote git repository (gitea.voser.cloud or github.com or ...)
2. Click ok to confirm the push.

### Counter Check on website

[![image-1649592244246.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/3wJab32GNFVGMP4a-image-1649592244246.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/3wJab32GNFVGMP4a-image-1649592244246.png)

1. Go to your Repository
2. Click on Commits

[![image-1649592339979.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/C01uYmt3L3OvBxJn-image-1649592339979.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/C01uYmt3L3OvBxJn-image-1649592339979.png)

Now you can click on the commit

[![image-1649592406415.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/ZcBwKgJVSnHX5g6k-image-1649592406415.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/ZcBwKgJVSnHX5g6k-image-1649592406415.png)

1. Here you see the commit name
2. Here are all edited files listed
3. Here you can see the changed lines a plus(green) or minus(red) in the beginning of the line. Plus means this line was added, minus means this line was removed