Skip to content

Lesson 0

Matt Huesman edited this page Oct 19, 2022 · 49 revisions

Clone this Git Repository

Most developers prefer to create repositories in their personal documents folder. Some developers like to create a "Project" folder under their C drive and host their repositories there. As a team we recommend creating a "github" folder within your documents folder to store projects.

  1. Open a command prompt. (Hit the Windows Button, type "command prompt", and press enter).

  2. Once the prompt opens you can change directories by using the "cd" command. For example, cd \Projects. If you have a "Projects" folder at the root of the C drive, you will be switched to the directory: C:\Projects using the previous command. If you want to use your Documents\github folder, you will find it under the C:\Users folder. When you open a command prompt, you will probably already be in your user folder. To get to the documents folder you should only need to type cd Documents and if you want to use the github folder you created simply type cd github.

NOTE: Do not include a backslash "\". Including a backslash means you want to change directories starting at the root, without it you want to change directories starting from your current location. Ask for help setting up a project folder if you are unfamiliar with DOS commands.

Once you have changed to the directory where you would like to work with your code, enter this command

git clone https://github.com/frc2052/2022-KnightKrawlerJavaTraining.git

This will create a new folder called "2022-KnightKrawlerJavaTraining" and copy all the code from the main branch on GitHub to your local computer.

Open the project and create a new branch

After cloning this project repository, open "WPILib VS Code". Under File, click "Open Folder," select the folder that contains the project code "KnightKrawlerJavaTraining", and click open.

Open Project

After opening the project, create a new branch by clicking "main" in the lower left corner of Visual Studio Code. Name the branch using your first and last name (firstName.lastName) for training, so captains and mentors can review your work.

New Branch

After creating the new branch, you should see the new branch name in VS Code. This will indicate you are currently working on your branch. You always want to work on your own branch, never on main. If you get stuck with Git ask for help. Git is complicated, even for very experienced developers. Don't worry if it takes a while to understand.

On Branch

Run the project

In the solution navigation on the left, click the file icon to see all the files in your project. Navigate to the Main.java file under the "src" folder and double-click the file to open it in the editor. With Main.java as the active window, you can run the application. Under the Run menu, click "Start Debugging" or press F5 as the shortcut.

Run Project

Clone this wiki locally