Log in if you already have an account. If you would like to become an editor for the wiki, request an account.
Difference between revisions of "Setting up Java with Git and BitBucket"
Line 3: | Line 3: | ||
==Setting Up Software== | ==Setting Up Software== | ||
#Download the latest version of [https://netbeans.org/downloads/ Netbeans]. Select Java SE and proceed with download. | #Download the latest version of [https://netbeans.org/downloads/ Netbeans]. Select Java SE and proceed with download. | ||
− | #Download GitHub | + | #Download GitHub or Git. [http://windows.github.com/ Windows] [http://mac.github.com/ 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. [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java JDK from Oracle] | #Make sure you have the latest version of Java JDK. Mac users have it preinstalled, but Windows users may not. [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java JDK from Oracle] | ||
#Open up NetBeans | #Open up NetBeans |
Revision as of 02:01, 20 August 2013
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 or 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. On Mac it is in 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 these commands:
git stash git pull git stash pop
If this does not work, delete your project folder and clone again.