Code Training Module Help

GitHub Setup

gitwhite.png

Setting up Git

In order to set up your repository correctly you will do 2 things. 1.Fork and 2. Clone. This will get the repository to your GitHub account and then put that repository local on your computer. Remember only one person will need to fork the repo then you will share it to the rest of your team. You will go through

settingsa
and to collaborators then add your team members using the add people button.

Forking

Go to this website and find the latest repository from the company. Press the fork button. This will "copy" the repository onto your GitHub account. Remember only one person will need to fork the repo per team!

Cloning the repository

To clone the repository, first find it on your GitHub profile. You have 2 options on what to do you can do it through android studio or through GitHub. Everyone on a team will need to do this!!

Android Studio: Tap fila, then newa, vcsa. Go back to your repository and copy the url, paste it into the box and make sure the destination is desktop. You might need to have an access token to do this.

GitHub: Navigate to the repository you want to clone. Tap

codea
then select
zipa
. This will download it to your computer. Extract the zip file (double click) and move it to desktop. Then, go back to Android Studio. Tap filea then opena and select the path where the folder is (desktop).

GitHub basics

GitHub is organized in a few sections. One, the code section, this is where your code and files are stored. Your repositories, where all of your code is stored and your profile, where all of your repositories are stored.

Commits

Committing is an essential part in every part of coding while connected to GitHub, it makes sure you have the latest edited version of your code local on your computer, we got the code local to the computer in cloning. In a GitHub file it is a green rectangular button at the bottom of the file that says commit changes,

gitCommita
when committing directly from GitHub it strictly gives the code to GitHub, you will not have the code local yet. To make your code local you will need to pull in your code app, most likely android studio. In android studio, the commit button is a check mark in your top right corner. commita You are also allowed to commit and push, to be explained later in push. You will also need a commit message to be able to push the commit.

Push

  • What is a push?

    • A push will essentially do exactly as it says, push the code to GitHub. This makes sure that you not only have the latest version of code locally, but also sent to GitHub through the cloud. This is essential for working on code together as a team and collaborating. The push button is the arrow next to the commit button, it will be pointing out, where you want the code to go. pusha Commit and push does both at the same time to simplify the process. Also see pull/merge

Pull/merge

  • What is a pull?

    • A pull is the exact opposite of a push. It will take the current version of the code directly from GitHub and sync it locally to your device/coding app. This is also essential as it allows you to get the teams latest version of code. This is helpful when multiple people are working on code all at once. If you are pushing sometimes it will ask you to merge your current code, this means you don't have the latest version, not to worry though as if you say yes GitHub will automatically merge and add your code to the latest code. The pull button is an arrow pointing in, or towards your computer. pulla

Managing your server

Managing a server is really not that hard if you do it correctly from the start. There is a settings

settingsa
button in your repository, in this tab you will find a bunch of options, it is better if you don't mess with anything that you don't know what it does. Other than that there are really no settings you need to mess with except maybe email notifications if you would like that.

Personal Access Token

In GitHub, tap on your profile ( top right corner ), then:

  1. step1a
  2. step2a
  3. step3a
  4. step4a
  5. step5a
  6. step6a

    ( Select all, it will work better that way )

Video Explanation of GitHub

Last modified: 20 March 2025