Intro to Android Development
  • Welcome
  • Syllabus
  • Hack Challenge
  • Resources
    • Lecture Videos
    • Ed Discussion
    • Git & GitHub Help/How-To
    • Setting up Android Studio
    • Starting an Android Studio Project & Making an Emulator
    • Importing, Exporting, & Submitting Your Projects to CMS
  • SP25 Course Material
    • Week 1 | Course Logistics, Kotlin, & Basic UI
      • Relevant Links
      • Demo/Lecture: Eatery Card
      • A0: Eatery Card (Follow-Along)
    • Week 2 | States, Components, LazyColumn
      • Relevant Links
      • Demo: Todo List
      • A2: Shopping List
    • Week 3 | Navigation & Animations
      • Relevant Links
      • Demo: Onboarding
      • A3: Stock Trading (RobbingGood)
    • Week 4 | MVVM and Flows
      • Relevant Links
      • Demo: Eatery Card 2
      • A4: Chat of a Lifetime
    • Week 5 | Dumb Components & UIEvents
      • Relevant Links
      • Demo: Music Player
      • A5: Rate My Vibe
    • Week 6 | Coroutines, Networking, JSON
      • Relevant Links
      • Demo: Retrofit
      • A6: You Should Even Lift, Bro.
  • Bonus Week | Android Job Search
    • Relevant Links
    • Android Technical Interview Question!
  • Textbook
    • 1. Introduction to the Editor and Views
      • 1.1 Introduction to the Editor
      • 1.2 SDK Management
      • 1.3 Kotlin Overview
      • 1.4 Views
      • 1.5 Android Studio Project Demo + Understanding The Editor
    • 2. Jetpack Compose
      • 2.1 Introduction
      • 2.2 Layouts
      • 2.3 Modifiers
      • 2.4 Animations
      • 2.5 Lazy Lists
      • 2.6 Reactive UI
    • 3. Intents and Manifest
      • 3.1 Activities
      • 3.2 Implicit Intents
      • 3.3 Explicit Intents
      • 3.4 Manifest
      • 3.5 Permissions
      • 3.6 Summary
    • 4. Navigation
      • 4.1 Types of Navigation
      • 4.2 Implementation of the Bottom Navigation Bar
    • 5. Data and Persistent Storage
      • 5.1 Singleton Classes
      • 5.2 Shared Preferences
      • 5.3 Rooms
      • 5.4 Entities
      • 5.5 Data Access Objects
      • 5.6 Databases
    • 5.5 Concurrency
      • 5.5.1 Coroutines
      • 5.5.2 Implementation of Coroutines
      • 5.5.3 Coroutines with Networking Calls
    • 6. Networking and 3rd Party libraries
      • 6.1 HTTP Overview
      • 6.2 3rd Party Libraries
      • 6.3 JSON and Moshi
      • 6.4 Retrofit
      • 6.5 Summary
    • 7. MVVM Design Pattern
      • 7.1 Key Idea
      • 7.2 Implementation Ideas
    • 8. Flows
    • 9. The Art and Ontology of Software
    • 10. 🔥 Firebase
      • 10.1 Setting up Firebase
      • 10.2 Authentication
      • 10.3 Analytics
      • 10.4 Messaging
      • 10.5 Firestore
  • Additional Topics
    • Git and GitHub
    • Exporting to APK
  • Archive
    • Archived Native Android Textbook Pages
      • 1. Layouts and More Views
        • 1.1 File Structure and File Types
        • 1.2 Resource Files
        • 1.3 Button and Input Control
        • 1.4 ViewGroups
        • 1.5 Summary + A Note On Chapter 2 Topics
      • 2. RecyclerViews
        • 2.1 RecyclerViews
        • 2.2 RecyclerView Performance
        • 2.3 Implementation of a Recycler View
        • 2.4 Implementation with Input Controls
        • 2.5 Filtering RecyclerViews
        • 2.6 Recyclerview Demo
      • 3. ListViews and Searching
        • 3.1 ListView vs. RecyclerView
        • 3.2 ListView Performance
        • 3.3 Implementation of a ListView
        • 3.4 Searching in a List View
      • 4. Fragments
        • 4.1 What are Fragments?
        • 4.2 Lifecycle of a Fragment
        • 4.3 Integrating a Fragment into an Activity
        • 4.4 Sharing Data Between Fragments
        • 4.5 Fragment Slide Shows
      • 5. OkHttp
      • 6. Activity Lifecycle
      • 7. Implementation of Tab Layout
    • Fall 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 1.5: Beauty of Kotlin
      • Lecture 2 & HW 2: Modifiers, Lazylists and Reactive UI
      • Lecture 3 & HW 3: Animations, Intents and Manifest
      • Lecture 4 & HW 4: Coroutines & Navigation
      • Lecture 5 & HW 5: Persistent Storage, Networking, and JSON Parsing
      • Lecture 6 & HW 6: MVVM, Flows
      • Bonus Lectures & Bonus HW
      • Bonus Lecture: Industry Practice
    • Spring 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 4 & HW 4: LazyLists
      • Lecture 6 & HW 6: Networking, Data, and Persistent Storage
    • Spring 2020 Course Material
      • Week 1: Intro to the Editor
      • Week 2: Views and Layouts
      • Week 3: Intent and Manifest
      • Week 4: ListView and RecyclerView
      • Week 5: Fragments
      • Week 6: Networking
    • Spring 2021 Lecture & HW 8: Networking & 3rd Party APIs
    • HackOurCampus Workshop
Powered by GitBook
On this page
  • Git Download: https://git-scm.com/downloads
  • Cloning the repository
  • How can we create repositories?
  • Making the change
  • Committing and pushing the change
  • Creating the pull request
  • Updating your local files

Was this helpful?

  1. Resources

Git & GitHub Help/How-To

PreviousSyllabusNextSetting up Android Studio

Last updated 7 months ago

Was this helpful?

Git Download:

With Android Studio, you don't need to use the terminal to contribute to an Android project on GitHub. It has native integration with git and GitHub to allow most actions via the Android Studio UI. Below gives an overview of some of these actions!

Cloning the repository

If your partner has already created a repo and added files, to get on the same repo, you must clone it! (You do not have to create another repo yourself!) If the repo is private, you must be added as a collaborator first (instructions ).

When you clone a repository, you copy the repository from GitHub.com to your local machine. Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project.

When you open Android Studio, it offers the option to open a project from version control. That's the option we'll use (you can also create a new Android Studio project from version control)

After selecting that option, you can type the URL of the repository, press "Clone", and select a folder. After that, Android Studio will do all the work and open the project ready to go.

How can we create repositories?

Creating repositories in Android Studio is pain-free (hopefully). If you're working with multiple people, only one person needs to create the repository!

First we have to add Git managing to our current Android Studio project

Go to: VCS -> Create Git Repository

Now, we have to create the repository on GitHub and share our files there!

Go to: Git -> GitHub -> Share Project on GitHub

You can then add your files to your newly created GitHub repository!

Make your repositories PRIVATE unless stated otherwise (e.g hack challenge)

Making the change

Initially, the default branch will be selected most likely master. Let's create a branch for our change based on the master branch! It's bad practice to make changes directly onto our master branch so we can utilize branches to create developmental spaces at the current state of the master without affecting the master branch!

To do that, click where it says "Git: [default branch]", select the master branch, click "New Branch from Selected", and choose a name for your branch.

Once you've actually made some changes to your new branch you have to commit them and push them online!

Committing and pushing the change

Now, we can commit our change. To do this, either press CMD+K (or CTRL+K on Windows) to bring up the commit panel!

Review your changes in the screen provided, write a descriptive commit message, select commit and push on the bottom. That will take you to the screen where you'll choose which repository the branch will be uploaded. If you're a maintainer of the origin remote, you can press "Push" and skip to "Creating the pull request".

Creating the pull request

Now, go to your repository page on GitHub, and you'll see a prompt to open a Pull Request with your newly pushed branch.

When you press that, it will take you to a Pull Request composer.

The Pull Request (PR for short) is the method by which — specifically using Git and GitHub — you can loop interested parties into reviewing and then approving your change, then merging it into some branch (presumably the trunk). This is where you explain the “whats” and “whys” of your code. Feel free to add your partners as reviewers for your code!

Once your PR has been reviewed and is "ready", it can then be merged into your master branch!

Updating your local files

With new changes being pushed from your PR into your master branch (from either yourself or your partner), your local files in Android studio are out of date! You can update your files by "pulling" the changes from your repository online into your local repository!

In the top right of your project there's a small toolbar for Git. The blue check mark will update your project!

If your repository is private, you should add your collaborators to your repository so they have access too (which you can now do with your newly created repo). The instructions for that are . Only the creator of the repository can add collaborators!

here
https://git-scm.com/downloads
here
Make sure you choose the correct account to clone from!
Your files will turn red, don't worry!
Commit panel
The buttons to the right commit and push respectively!