Blog #3: Eclipse & Git, Commit & Push

Most IDE should have a way to commit to, push to, and pull from GitHub repositories. This is a tutorial of how to commit and push from Eclipse to GitHub.

Step 1: Create a GitHub account if you haven’t already. Since I already have a GitHub account, I can click on the “New” green icon to create a repository.

Step 2: Give the repository any name.

Figure 3.1: Create a repository.

Step 3: After creating a repository, check the repository link. My HTTPS link is:

https://github.com/swiftandquick/Personal-Projects.git

Figure 3.2: HTTPS link.

Step 4: By default, the Open Perspective option should be on Eclipse’s top right corner. Click on it.

Figure 3.3: Open Perspective.

Step 5: In the pop up, choose Git.  Open it.  To go back to original perspective, choose Java (default)

Figure 3.4: Open Git.

Step 6: In the Git Repositories panel. Choose Clone a Repository, that is because I already created a repository. 

Figure 3.5: Clone a Repository.

Step 7: In the URI text field, copy the URI from my repository to this pop up. After entering the GitHub URI, Host and Repository Path are automatically set up.

Figure 3.6: Enter URI.

Step 8: Click next, at the Local Destination page, click finish.

Step 9: Local Git repositories is created.

Figure 3.7: Local GIt repositories.

Step 10: Go back to the original perspective via Java (default).

Figure 3.8: Go back to original perspective.

Step 11: Right click on project folder. Choose Team, then Share Project. When the Configure Git Repository window pops up. Choose the correct folder to share project on the Repository section.

Figure 3.9: Share Project…

Step 12: Go back to the Git perspective.

Figure 3.10: Return to Git perspective.

Step 13: Go to Git Staging tab, select files from Unstaged Changes.

Figure 3.11: Unstaged Changes.

Step 14: Click on the green plus sign to add files to Staged Changes.

Step 15: Type anything in Commit Message.

Step 16: Click on Commit and Push.

Step 17: In Push Confirmation, click Next, then type in GitHub username and password. Store both in Secure Store.

Figure 3.12: Insert GitHub username and password.

Step 18: Enter two security questions. It’s for password recovery.

Preview(opens in a new tab)

Figure 3.13: Set up security questions.

After this, the project folder should be pushed onto a GitHub repository.

Troubleshooting

If I cannot see any files in Unchanged Files section, I can click on the downward triangle, then select the associated project folder.

Figure 3.14: Make Unchanged Files reappear.

Final Note

Eclipse always updates its IDE, so this way of uploading project folders onto GitHub doesn’t always stay true.

Leave a comment

Design a site like this with WordPress.com
Get started