github for ftc - ftc 8404 quixilvergithub android studio setup github organization account git...

Post on 16-Oct-2020

10 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

GITHUB FOR FTCTeam 8404 Quixilver

About Us

• Quixilver 8404

• Leland High School

• 5th year competing

Why Version Control

• Backup and restore

• Compare file versions at different points in time

• Collaboration

• SDK updates

Agenda

Tools Git Version Control

GitHubAndroid Studio

SetupGitHub

Organization Account

Git ClientRepository

CloningAndroid Studio

Workflow Understanding Branches

Changing Code

Pull Requests SDK Updates

TOOLSGit, GitHub, Android Studio

What is Git

• Git is an open-sourced version control system

• Keeps track of revisions over time and shows incremental changes• Easily revert chunks of code or

compare differences at different points

• Staging area

• Branching model• Create new branch for testing new

ideas

• Merge branches to bring experimental code into the primary codebase

What is Git (Continued)

• Exists locally on your programming computer as a set of command line utilities

• Many applications available that provide a more friendly user interface

GitHub (different from git)

• Online platform to host your code remotely

• Linked to the local code stored on each programmer’s individual computers

• Allows collaboration by uploading changes from a local branch to the remote branch and vice versa

• Discuss edits before merging a development branch into the “master” branch• Ensures compatibility and a consistent code style

• Holds the official FTC SDK

Android Studio

• Tinker with your codebase

• Create and modify source files

• “Build” the source files into an android application (apk file)

• Deploy the built app onto the robot controller android phone

• Monitor and debug application at runtime

SETUPGitHub account, setting up a repository, local git client, android studio

GitHub OrganizationPage

+Remote Repository

GitHub Accounts

Git ClientGitHub Desktop

GitKraken

Local Repository

Android Studio Robot Controller

FTC SDK Repository

GITHUB ORGANIZATION AND ACCOUNTS

GitHub.com

SIDE NOTE:

GITHUB STUDENT

PACK

INSTALLING GITgit-scm.com

Run the Installer

• Leave All Settings to Defaults

• Mac Setup May Differ

DOWNLOADING GITHUB DESKTOPdesktop.github.com

USING GITKRAKENgitkraken.com

Side Note: Alternative SDK’s• OpenRC

• Removes unnecessary components

• Reduces build and deploy time

• 18 mb apk -> 1.3 mb apk!!!

• Not official or game legal

• Option available to quickly switch between optimized and official library’s for legal usage during competitions

• Simply change upstream URL and pull branch “master”

Change URL for SDK

DOWNLOAD ANDROID STUDIOdeveloper.android.com/studio

THE WORKFLOWBranches, Commits, Pull Requests, and SDK Updates

The Process

Code Master Branch

New FeatureBranch

Ex: TeleOp Program

Commit Commit

Tele.java Edits

NewCode

Pull Request

NewCode

Code Review

Code Review

Approval

Merge

Creating New Branches

SWITCHING BRANCHES

COMMITTING CHANGED

CODE

Pushing Code to Remote

PULL REQUESTSMethod 1: Using GitKraken

Method 2: Using GitHub’s web interface

Method 1: GitKraken

• Select the current working branch for “from”

• Select the master branch for “to”

• Add a title, description, and reviewers

• Create Pull Request

Method 2: GitHub’s Web Interface

• Click New Pull Request

• Choose 2 branches

UPDATING THE SDKPulling changes from the FTC SDK’s GitHub

Pulling SDK Changes

• Identical to adding upstream remote and pulling during initial setup

• Possibility of merge conflicts if core SDK files are modified

• Follow prompts to resolve conflicts by selecting which code chunks to keep

• Remember to “push” changes back to your team’s remote

THE ENDhttps://quixilver8404.weebly.com/

top related