Set up 3: GitHub and the robot project
Do it on each laptop.
You get the robot project onto the laptop and open it in Android Studio. Each step has two ways. Use the one your team likes:
- GitHub Desktop: a free app with buttons (desktop.github.com).
- The command line: commands you type. On this page you type them in your computer’s own terminal, because no project is open in Android Studio yet (which terminal).
1. Tell git who you are
Section titled “1. Tell git who you are”GitHub Desktop:
- Install GitHub Desktop.
- Open Settings > Accounts (Windows: File > Options > Accounts).
- Sign in with your GitHub account.
Command line:
-
Find your private GitHub email: on github.com, click your picture (top right) > Settings > Emails.
-
Tick Keep my email addresses private. GitHub then shows an address like
[email protected]. -
Type these four lines, one at a time. Change
YOUR-NAMEand the email to your own. Keep the quotes.Where: your computer’s own terminal (Mac: the Terminal app; Windows: PowerShell). Android Studio has no project open yet, so it has no Terminal tab. (Which terminal)
Terminal window git --versiongit config --global user.name "YOUR-NAME"git config --global pull.rebase falsegit --versionmust printgit version 2.... If it saysnot recognized, read git is not recognized.- Why the private email and a first name: a public project’s history is public.
2. Get the robot project
Section titled “2. Get the robot project”Pick one.
A. Your team already has a project on GitHub (the usual way)
Section titled “A. Your team already has a project on GitHub (the usual way)”Ask your mentor or code lead for its address.
GitHub Desktop:
- File > Clone Repository…
- Pick the URL tab and paste the address.
- Pick a folder on your laptop.
- Click Clone.
Command line:
Where: your computer’s own terminal (Mac: the Terminal app; Windows: PowerShell). Android Studio has no project open yet, so it has no Terminal tab. (Which terminal) It starts in your home folder. The clone makes a new folder there, named after the project.
git clone --recurse-submodules https://github.com/OUR-TEAM/OUR-ROBOT.gitWhy --recurse-submodules: the library sits inside the project as a submodule (a project kept
inside another project). This option gets it too. GitHub Desktop gets it by itself.
B. Your team has no project yet
Section titled “B. Your team has no project yet”A mentor or code lead does this once for the team.
- Go to github.com/FIRST-Tech-Challenge/FtcRobotController.
- Click Fork (top right), and make the copy under your team’s GitHub account. Why fork: the team gets its own copy on GitHub to share.
- Clone your team’s copy as in A above.
- Then a mentor adds the library: Add the library.
3. Open the project in Android Studio
Section titled “3. Open the project in Android Studio”-
File > Open.
-
Pick the top project folder: the one with
TeamCodeandFtcRobotControllerinside it. Why the top folder: Android Studio needs the whole project, not onlyTeamCode. -
Wait for the first Gradle sync. Gradle is the tool that builds the app. A progress bar is at the bottom right. The first sync downloads a lot, so it takes a while. Why wait: until the sync is done, Android Studio shows many false red errors.
-
In the Project panel (left), click the list at its top (it says Android) and pick Project.
-
Open the folders down to
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/. This is where your team’s code goes.
Problems
Section titled “Problems”| You see | Do this |
|---|---|
The ftc-helper-lib folder is empty |
In Android Studio’s Terminal tab, in the project folder: git submodule update --init |
The build says Project directory '.../ftc-helper-lib/library' does not exist |
The same command |
There is no ftc-helper-lib folder |
Nobody has added the library yet: Add the library |
Done when
Section titled “Done when”The project is open in Android Studio, the sync is finished, and you can see the teamcode folder.
Next: Add the library. If there is already an ftc-helper-lib folder
with files in it, skip to Update the hubs.
Look it up: Git and GitHub for FTC teams and Troubleshooting: git problems.
Something wrong on this page? Tell us with a short GitHub form.