Skip to main content

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

Navigate to your workspace

Navigate to your workspace directory.

image-1649588539574.png

Clone the repository

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

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

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

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

image-1649590514694.png

Afterwards you can see the Project folder on the left side. You can press <ctrl>+<b> 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

  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

  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

Click on the plus sign of the modified file.

Commit

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

Enter a commit message which describes the changes

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

  1. Go to your Repository
  2. Click on Commits

image-1649592339979.png

Now you can click on the commit

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