On Setting up the Code Repositories - Pattonville-Robotics/Library-of-Alexandria GitHub Wiki
Preface
This process only needs to be done once! To pull changes from others, simple use the blue downward-facing arrow button "Update Project" in Android Studio to update all projects.
Step-by-step Instructions
Setting up GitHub
- Create a GitHub account. Add your name, email, etc.
- Get invited to the Pattonville Robotics organization.
- Get added to the appropriate team.
Setting up Android Studio
- Open Android Studio and go to Configure -> Settings -> Version Control -> GitHub.
- Log in with your GitHub credentials and test your connection to verify.
Cloning the Main Repository
- Return to the welcome screen and go to "Check out project from Version Control" -> GitHub.
- Click the drop-down and select the repository titled "Main-Repository".
- Click "Clone" and wait for the download to complete. It will take some time on a slow network.
- "Yes" when a prompt appears asking if you would like to open a project file that was just checked out.
- Click "OK" on the "Import Project from Gradle" prompt to chose default settings.
- If there is no error, skip to step 8. If there is an error, cancel the import.
- Go to "Open an existing Android Studio project" and select and open the folder "~/StudioProjects/Main-Repository"
- Click "Add root" on the "Unregistered VCS Root Detected" prompt to tell Android Studio that this project is a Git repository.
Setting up Git
- Open the "Terminal" tab in Android Studio.
- Type the following:
git config --global user.email "[email protected]"
, replacing the example email with the one supplied in Setting up GitHub, and press "return". - Type the following:
git config --global user.name "Mona Lisa"
, replacing the fake username with your own first and last name. This is not your username!
Cloning the rest of the Repositories
Repositories to be Cloned
For Each Repository to be Cloned
- Navigate to the repository page by clicking on the above link.
- Click on the green "Clone or download" button and copy the web URL, i.e.
https://github.com/Pattonville-Robotics/Common-Code.git
- Return to the "Terminal" tab of Android Studio and type in
rm -r $repository_name
and press return, where$repository_name
is the name of the repository you are currently cloning. - Type in
git clone $repository_url
, where$repository_url
is the web URL you copied in step 2. This process will take some time on a slow network. - When prompted by Android Studio in the "Event Log" tab, click the "Add root" option.
- Go back to step 1 using the next repository on the list above or finish if you have cloned every repository in the list.
Preventing mistakes
- Open the "Version Control" tab in Android Studio.
- Press the blue refresh symbol "Refresh VCS Changes".
- Click the green plus "Create new changelist" and title it "Don't Commit".
- Drag the 4 unknown files named for each repository to the new changelist called "Don't Commit".
For extra help setting up, contact @magneticflux-