-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson 0
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.
-
Open a command prompt. (Hit the Windows Button, type "command prompt", and press enter).
-
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 yourDocuments\github
folder, you will find it under theC:\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 typecd Documents
and if you want to use the github folder you created simply typecd 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.
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.
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.
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.
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.
If you get stuck or need help check with a returning student, captain, or mentor, but first try and search for a solution using online resources like StackOverflow. If you run into compiler or runtime errors sometimes even running a simple google search can be helpful in identifying bugs within your code.
Great programmers are great problem solvers and sometimes one of the best tools for solving the problems we face is simply by googling it.