Follow this routine every single time you work on the project to keep everything stable.
- Always develop and edit code on your PC. The robot cannot access the internet, so transfer files to the robot only for testing.
- If you make changes directly on the robot, transfer them back to your PC, then commit and push from there.
- Why? This ensures all changes are tracked in Git on the PC, prevents desyncs, and maintains a clean history on GitHub.
-
Open Visual Studio Code
- Open VS Code -> choose "open folder" -> choose the folder containing the repository
-
Git pull (always do so before working)
- Open your terminal in the project folder (eg.
Team-A1). - Pull the latest changes from the remote:
git pull origin your-branch
- If conflicts appear → resolve them carefully (see Troubleshooting below).
- (Optional: Run git status to confirm clean working tree.)
- Open your terminal in the project folder (eg.
-
Go on to develop
- Save frequently or enable auto-save in VS Code
-
Stage, commit & push
- Stage all changes:
git add . - Commit with a clear message:
git commit -m "your commit message"- Good commit messages: what + why (short & descriptive)
- Push to remote:
git push origin your-branch
- If push rejected (non-fast-forward), it means someone else pushed meanwhile. Git pull again, resolve, then push.
- Stage all changes:
-
Start session – on PC
- Pull from github (follow the steps in A1)
-
Transfer to robot
- Copy needed folders/files to robot using a USB
-
Work on robot
- Run experiments / training / testing
-
Transfer back to PC If you have editted the code on the robot, copy back to your PC into correct places.
-
Back on PC – commit changes
- Push to github (follow the steps in A4).
Rule of thumb: One branch per meaningful piece of work (eg. 1 training session homework)
-
Creating a new branch
- You should start a new brach at each training session
git checkout main git pull origin main git checkout -b new-branch
-
Working on branch
- Commit often
- Push regularly so others can see progress
git push origin new-branch
-
Finishing & Merging
- When the task is completed and reviewed, merge back to main Make sure branch is up-to-date
git checkout new-branch git pull origin tnew-branch
Switch to target branch (usually main)
git checkout main git pull origin main
Merge (use --no-ff to keep history clear)
git merge new-branch --no-ff
- resolve conflicts if any
Push integrated result
git push origin main (Optional – delete the branch) ```bash git branch -d new-branch git push origin --delete new-branch
- Push rejected? git pull origin main first.
- Merge conflicts? Edit files (choose which version to keep, or edit manually), commit & push again. Usually safe to keep "theirs" or "ours" based on who changed the asset last.
- Still stuck? Run git status, screenshot errors, and ask excos.