Collaboration with Git - SimDynamX/SpaceTeamsPRO GitHub Wiki

Up to date for Platform 0.31.1.

Written by Connor Jakubik


Collaboration with Git

Space Teams PRO has a preferred way for users to collaborate on project files. Space Teams has tools. Follow these instructions to clone and set up git repositories.  

Quick Git / GitHub Primer

Git is a distributed version control system used to track changes in source code during software development. It allows multiple developers to collaborate on projects (repositories) by creating, managing, and merging branches. Git stores snapshots (commits) of project files over time, enabling users to revert to previous versions if needed. It is widely used in both individual and team development workflows for its efficiency and flexibility.

GitHub is a web-based platform that hosts Git repositories, allowing developers to store, share, and collaborate on code. It provides tools for version control, issue tracking, and project management, making it easier for teams to work together. GitHub also supports features like pull requests and code reviews, streamlining the process of contributing to open-source and private projects.

STU Lunar SAR Git Setup

Our public SimDynamX/PythonSystemTemplate git repository, hosted on GitHub, is the starter code that we give out to participants to start programming their autonomous search and rescue algorithms. The SimDynamX copy of the repository will be consistently updated throughout the competition as we add more sims and functionality to the starter code for tasks past Task 1. The SimDynamX repository is set up as a Template Repository, so there is an easy way for participants to duplicate it and modify their (private) copy as their own repository. Once your team has made their own copy, they should probably keep using Git / GitHub to collaborate on code and data additions and changes. One good reason for that is: when it is time to submit for a task, the submission will involve filling out a form and providing a GitHub link to a particular commit (saved state) on your repository.

Some teams may opt to have only a few of the team members actually set up GitHub accounts or Git on their computers, and that is ok.

The following steps show how to set up your team's repo.

1. GitHub account setup

  1. Every member of your team should probably have their own GitHub.com account
  2. https://docs.github.com/en/get-started/onboarding/getting-started-with-your-github-account

2. Create a repository from the STU Lunar SAR Template for your team:

Screenshot 2024-10-22 014644

  1. Go to https://github.com/SimDynamX/STU_Lunar_SAR
  2. Use this template -> Create a new repository Screenshot 2024-10-22 014812_marked
  3. Set the Owner to your own account, and Repository Name to STU_Lunar_SAR_Your_Team_Name, substituting a unique-enough name.
    1. For example, STU_Lunar_SAR_AstroBlasters
  4. Set repository to Private so your changes are not publicly viewable
  5. On your new repository, use Settings -> Collaborators -> Add People to give your fellow team members permissions to access and modify the repository.

3. Back on https://github.com/SimDynamX/STU_Lunar_SAR, enable notifications for Release updates

Screenshot 2024-10-22 014928 Screenshot 2024-10-22 014938

  1. Watch -> Custom -> check Releases -> Apply
  2. This way, you will be notified by email when we update the competition starter code for the remaining tasks and any bug fixes.

4. Clone your copy of the repository in Space Teams

image (14)

  1. Open SpaceCRAFT/SpaceCRAFT.exe where you installed Space Teams Pro
  2. Sign in to your account
  3. On the title menu, Project Management -> Clone a Repo
  4. Fill in the HTTPS Clone URL of your team's copy of the STU Lunar SAR repo
  5. Folder name will automatically populate
  6. Clone
  7. Refresh once the Clone is complete
  8. Now continue to the Lunar SAR API Docs wiki page for further instructions for how to set up and run sims.

STU Lunar SAR Git Collaboration

Space Teams PRO has a simplified interface in the SpaceCRAFT app Project Management tab of the main title menu for collaborating using Git Repositories in the Local Assets folder. This allows the user to:

  • Clone a repo (download it and set it up with Git in the proper folder to be visible to Space Teams)
  • Refresh button that does a git fetch operation that compares the state of all repos to their online copy
  • Pull changes (download and apply commits (changes) that were made on a different computer then Pushed)
  • Push changes (upload changes that were made on the user's computer to the online copy)

Lots of the time, these commands will be the only ones you need. When you start working, do a Refresh to see if any of your cloned repos can be updated. Do a Pull on the repos that are ahead of your copy with online changes. Do your work, changing files as you go. Every now and then, probably close to once per hour, do a Push, which uploads your changes so your team members can Pull them.

You can look through the entire history of every change that was ever pushed on the GitHub repo site for your copy.

Merge Conflicts

If two people edit the same section of the same file from the same starting point, a Merge Conflict happens. This cannot be sorted out through the Space Teams PRO git interface. We recommend setting up GitHub Desktop on your computer to handle these edge cases. More info on merge conflicts is available here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts

GitHub Desktop Setup

  1. Install https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/installing-github-desktop
  2. Sign in with your GitHub account
  3. Add your STU repository
    1. (GitHub.com instructions: https://docs.github.com/en/desktop/adding-and-cloning-repositories/adding-a-repository-from-your-local-computer-to-github-desktop)
    2. with File->Add local repository->Choose...
    3. Navigate to C:\Users\YOUR WINDOWS USERNAME\AppData\Local\SimDynamX\STPro\Assets\Repos
    4. Select the STU_Lunar_SAR_YourTeamName folder
    5. Add repository
  4. Learn about how to use GitHub Desktop here: https://docs.github.com/en/desktop/overview/getting-started-with-github-desktop