Skip to content

Committing your HTML site to GitHub then checking it out to modify it into a Java EE project

Jake Zuehlke edited this page Sep 3, 2018 · 2 revisions

Step 1: Set up repository

In your GitHub account, go to repositories and create a new one called Distributed-Java or similar. Don't add anything to it at this point, not even the readme.txt they hint at adding.

Step 2: Commit your HTML project

Download the git application off of google, choose all the recommended checkboxes. Now that you have git, you can now right-click your HTML project folder and open with Git bash. All this does is open the Git bash window with the directory set to what you right-clicked. Now, follow this page from step 4: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

Your project should now be committed to your new repository. Verify all went well on your GitHub account page.

Step 3: Link your GitHub account into IntelliJ

Open IntelliJ and click the tiny configure gear at the bottom for settings. Go down to Git, then change the "Path to Git executable" to wherever your git.exe file is saved on your computer. For me it was in C:\Program Files\Git\bin\git.exe

Next, back in settings, go to the GitHub section. You will see an open space to link your account. For me, entering my username (or email) and password wouldn't work, but it may for you. If it doesn't work, go to your GitHub account, click your profile, and go to settings. From settings, go to Developer Settings (at the bottom), then to Personal Access Tokens. You can then generate a new token to use in IntelliJ. Personally, I just named mine IntelliJ and checked the boxes for repo and gist. Save it, and you should be able to copy that token (this is your only chance to copy it before it hides forever), then you can enter that token in IntelliJ in lieu of a username/pass in the GitHub account link area.

Apply or Save your settings changes!

Step 4: Check out your repository in IntelliJ

In IntelliJ's main screen and choose "Check out from version control" then choose Git. The URL should now have a dropdown of your GitHub account's available repositories to check out. Choose the one you stored your HTML project in, the directory should be generated for you. Clone! It should now prompt if you want to create an IntelliJ project out of your clone, say yes, and go through the setup wizard. You should now have a basic project open in IntelliJ with all your HTML files in it.

Step 5: Add the Java EE module to your project

Right click your project's main folder on the left side directory in IntelliJ. A short ways down there should be an option to import a module. Click that, and a familiar screen should pop up! As we did in class, choose Java Enterprise on the far left, Web Application in the center options, and the Java JDK 1.8.0_181, Java EE8, and Glassfish Sever 5.0 at the top. Give it a name, almost done!

Step 6: Modify and Commit your project

Now that you have the Java EE module added, click and drag all your HTML/CSS/JS files (and media) to the web folder, which is located under the newly created Java EE project folder you created. Test your site by running it with the green arrow. Now commit all your new changes to your GitHub repository by clicking the VCS button at the top and clicking Commit. Commit any red/new/updated files and add your commit message. Congrats, you're all done!

Clone this wiki locally