Skip to main content
Responsible
  • Samuel Schoenenberger
Last Updated10/12/2025, 12:48:54 PM
Last AuthorKai Berszin

Git Guide

Scope

This is a short introduction to Git.

Getting started

When you join our team, or get a new machine, follow this guide to set up the development environment.

  1. Make sure you have git installed

  2. Make sure you have an SSH key associated with your GitHub account according to this guide.

  3. In Terminal / Command prompt navigate to the folder where you want to have your SAGE related code

  4. Use this command to clone (download) the repository: git clone git@github.com:aris-space/[repo-name].git

Before starting work on a new feature

  1. Make sure you are on the main branch: git checkout main

  2. Make sure your local version is up to date: git pull

  3. Create a new branch for your feature: git checkout -b [name_of_your_branch]

  4. Push your feature to the remote repository: git push -u origin [name of your branch]

Now you have prepared the workspace to develop a new feature. After you do some work, you can commit it.

Before starting to work

Any time you want to work on something, check these things:

  1. Are you on the correct branch? git status

  2. If not, switch them using git checkout [branch name]

  3. Make sure the branch is up to date git pull

After finishing a part of the new feature

  1. Check, which files you changed: git status

  2. Select the files to commit: git add [relative_path_to_file]

  3. Commit the files: git commit -m "[commit message]" (Don't forget to use a good commit message!)

  4. Push the changes to the remote repository: git push

If you have finished the feature (usually over multiple commits), you can try merging it into the main branch.

After finishing the new feature

  1. Make sure you have commited all desired changes.

  2. switch to the main branch: git checkout main

  3. Make sure your local version is up to date: git pull

  4. Switch back to the feature branch: git checkout [name of your branch]

  5. Update your feature branch with newest changes from main: git merge main

  6. Make sure your new feature still works. If not, fix it and commit the changes.

  7. Push the changes to remote: git push --force (It is important to use the --force flag, otherwise git is going to reject your push and ask you to pull first. DO NOT DO THAT!)

  8. Use the github website to create a new pull request from your branch to main, select the reviewer and wait for it to be accepted or changes are requested.

Fixing issues

If something went wrong, these might be possible fixes. If they don't cover your problem, contact Hynek and he'll help you resolve the issue.

  • You added something for commit, which you didn't want to. Remove it by: git checkout [relative_path_to_file]