Your first steps with git
Clone your git repository
Get the git url
Navigate to your workspace
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
Open repository in your editor
Open this directory in VScode with the following command code .
In Visual Studio Code you need to trust the author of this repository.
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.
- Click on the file you want to edit.
- Edit the line, you will see a blue mark in the beginning of the line, if the line was modified.
- 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
Add files to commit
Click on the plus sign of the modified file.
Commit
- Every file in the Staged changes gets commited with the same commit comment.
- Click on Commit to add the changes
Enter a commit message which describes the changes
- Click on Sync Changes to push the changes to your remote git repository (gitea.voser.cloud or github.com or ...)
- Click ok to confirm the push.
Counter Check on website
- Go to your Repository
- Click on Commits
Now you can click on the commit
- Here you see the commit name
- Here are all edited files listed
- 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