Log in if you already have an account. If you would like to become an editor for the wiki, request an account.
Setting up Java with Git and BitBucket
This article or section is a stub. This means it lacks key information or is not complete yet. You can help by adding to it. Click here to see some more stubs to work on. |
As of 2014, programming was done using GitHub as a method of pushing and pulling commits, BitBucket as a method of online repository storage, and NetBeans as the IDE. This thorough and conclusive tutorial will also provide complete support for Windows XP to Windows 8 and Mac OS X up to Mountain Lion 10.8.3. Linux is most likely an option, but most testing has thus far been on Windows and Mac. Future and other operating systems should not be too hard to figure out, either.
Setting Up Software
- Download the latest version of Netbeans. Select Java SE and proceed with download.
- Download GitHub, not Git. Windows Mac. Install with default everything.
- Make sure you have the latest version of Java JDK. Mac users have it preinstalled, but Windows users may not. Java JDK from Oracle
- Open up NetBeans
- Go to the Tools Menu and select "Plugins"
- We must now install the FRC Plugins from FIRST. Click on the Settings tab and click the "Add" button. Name it something along the lines of "FRC Java" and paste in the URL "http://first.wpi.edu/FRC/java/netbeans/update/Release/updates.xml" (as of 2014).
- Now click the Available Plugins Tab and select all plugins from the name you wrote in the previous step (e.g. "FRC Java"). Now click "Install".
- Click through the download and click "Continue" when it says something about the plugins being unsigned. Restart the IDE when it suggests so.
- Now check to see if an FRC logo is present in the toolbar. If it is, you did it right.
- If you are working at home or the computers at school finally have internet access, we must set up Git to let you push and pull commits. Move to the next section.
Set-Up
Commits are changes or edits to a programming project online. They exist to update a repository, or project, by multiple people, like a Google Drive document, except you must manually "push" your changes to the server and "pull" modifications by other people to your computer to update it. We are using in 2014 BitBucket as the online storage for the program repository so multiple programmers may edit it.
Windows: Open up "Git Shell" from Windows Start Menu Search or wherever. Not GitHub. We won't be using GitHub, just Git Shell that comes with it. Mac: Mac users will open up Terminal.
First-time users must "clone," or copy the project to the computer. Enter into Git Shell or Terminal:
git clone address of the bitbucket repository, e.g. https://bitbucket.org/PRHS/frc2013_ultimateascent.git -b develop
Upon command completion, the project should now be in some folder on the computer. Default on Windows is in the GitHub folder in the user's Documents folder...? On Mac it should be the user's home folder.
Pulling
To pull, you must enter these codes into Git Shell or Terminal:
cd the folder directory of the project on the computer; you can also drag the folder to this window git pull
If pull ever happens to fail, move to the Stashing section of this page.
We recommend pulling every time you begin programming to make sure your code is up to date.
Pushing
cd the folder directory of the project on the computer; you can also drag the folder to this window git add * git commit -a -m "short comment about what you changed, e.g. fixed bug in autonomous" git push origin develop
Stashing
When pulling fails, try to execute the stash commands:
git stash git pull git stash pop
If this does not work, delete your project folder and clone again.