GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git...

56
GITHUB FOR FTC Team 8404 Quixilver

Transcript of GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git...

Page 1: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

GITHUB FOR FTCTeam 8404 Quixilver

Page 2: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

About Us

• Quixilver 8404

• Leland High School

• 5th year competing

Page 3: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 4: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Why Version Control

• Backup and restore

• Compare file versions at different points in time

• Collaboration

• SDK updates

Page 5: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Agenda

Tools Git Version Control

GitHubAndroid Studio

SetupGitHub

Organization Account

Git ClientRepository

CloningAndroid Studio

Workflow Understanding Branches

Changing Code

Pull Requests SDK Updates

Page 6: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

TOOLSGit, GitHub, Android Studio

Page 7: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 8: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 9: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 10: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 11: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 12: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

GitHub OrganizationPage

+Remote Repository

GitHub Accounts

Git ClientGitHub Desktop

GitKraken

Local Repository

Android Studio Robot Controller

FTC SDK Repository

Page 13: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

GITHUB ORGANIZATION AND ACCOUNTS

GitHub.com

Page 14: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 15: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 16: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 17: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 18: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 19: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 20: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 21: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

SIDE NOTE:

GITHUB STUDENT

PACK

Page 22: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

INSTALLING GITgit-scm.com

Page 23: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 24: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 25: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 26: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Run the Installer

• Leave All Settings to Defaults

• Mac Setup May Differ

Page 27: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

DOWNLOADING GITHUB DESKTOPdesktop.github.com

Page 28: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 29: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

USING GITKRAKENgitkraken.com

Page 30: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 31: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 32: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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”

Page 33: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Change URL for SDK

Page 34: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 35: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

DOWNLOAD ANDROID STUDIOdeveloper.android.com/studio

Page 36: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 37: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 38: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 39: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 40: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 41: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 42: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

THE WORKFLOWBranches, Commits, Pull Requests, and SDK Updates

Page 43: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 44: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Creating New Branches

Page 45: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 46: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

SWITCHING BRANCHES

Page 47: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

COMMITTING CHANGED

CODE

Page 48: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 49: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Pushing Code to Remote

Page 50: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code
Page 51: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

PULL REQUESTSMethod 1: Using GitKraken

Method 2: Using GitHub’s web interface

Page 52: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 53: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

Method 2: GitHub’s Web Interface

• Click New Pull Request

• Choose 2 branches

Page 54: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

UPDATING THE SDKPulling changes from the FTC SDK’s GitHub

Page 55: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

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

Page 56: GitHub for FTC - FTC 8404 QuixilverGitHub Android Studio Setup GitHub Organization Account Git Client Repository Cloning Android Studio Workflow Understanding Branches Changing Code

THE ENDhttps://quixilver8404.weebly.com/