| Responsible |
|
| Last Updated | 10/12/2025, 12:48:54 PM |
| Last Author | Kai 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.
-
Make sure you have git installed
-
Make sure you have an SSH key associated with your GitHub account according to this guide.
-
In Terminal / Command prompt navigate to the folder where you want to have your SAGE related code
-
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
-
Make sure you are on the main branch:
git checkout main -
Make sure your local version is up to date:
git pull -
Create a new branch for your feature:
git checkout -b [name_of_your_branch] -
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:
-
Are you on the correct branch?
git status -
If not, switch them using
git checkout [branch name] -
Make sure the branch is up to date
git pull
After finishing a part of the new feature
-
Check, which files you changed:
git status -
Select the files to commit:
git add [relative_path_to_file] -
Commit the files:
git commit -m "[commit message]"(Don't forget to use a good commit message!) -
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
-
Make sure you have commited all desired changes.
-
switch to the main branch:
git checkout main -
Make sure your local version is up to date:
git pull -
Switch back to the feature branch:
git checkout [name of your branch] -
Update your feature branch with newest changes from main:
git merge main -
Make sure your new feature still works. If not, fix it and commit the changes.
-
Push the changes to remote:
git push --force(It is important to use the--forceflag, otherwise git is going to reject your push and ask you to pull first. DO NOT DO THAT!) -
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]