Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Upload Eclipse Projects to GitHub?

People also ask

Can you link Eclipse to GitHub?

Loading an existing project from github to Eclipse: 1. For your partner to download the project, they need to click Window → Show View → Other → Git → Git repositories. Then select “Clone a git repository and add it to this view”.

Can I upload Java file in GitHub?

Upload the Java projects to Github Note: Only the person sharing the Java files needs to create the Github repository. Everyone else will clone and pull from this repo. Create a Github repository. In the right-side of the page, copy the HTTPS clone URL.

How do I open an Eclipse project in GitHub?

Open Eclipse and choose Import –> Projects from Git (with smart import) Choose the Clone URI option in the Git import wizard and click Next. Confirm the URI, Host and Repository path parameters and click Next. Choose the Git branches to clone from the remote repository and click Next.


While the EGit plugin for Eclipse is a good option, an even better one would be to learn to use git bash -- i.e., git from the command line. It isn't terribly difficult to learn the very basics of git, and it is often very beneficial to understand some basic operations before relying on a GUI to do it for you. But to answer your question:

First things first, download git from http://git-scm.com/. Then go to http://github.com/ and create an account and repository.

On your machine, first you will need to navigate to the project folder using git bash. When you get there you do:

git init

which initiates a new git repository in that directory.

When you've done that, you need to register that new repo with a remote (where you'll upload -- push -- your files to), which in this case will be github. This assumes you have already created a github repository. You'll get the correct URL from your repo in GitHub.

git remote add origin https://github.com/[username]/[reponame].git

You need to add you existing files to your local commit:

git add .   # this adds all the files

Then you need to make an initial commit, so you do:

git commit -a -m "Initial commit" # this stages your files locally for commit. 
                                  # they haven't actually been pushed yet

Now you've created a commit in your local repo, but not in the remote one. To put it on the remote, you do the second line you posted:

git push -u origin --all

Here is a step by step video of uploading eclipse projects to github

https://www.youtube.com/watch?v=BH4OqYHoHC0

Adding the Steps here.

  1. Right click on your eclipse project -> Team -> Share project

  2. Choose git from the list shown; check the box asking create or use repository -> click on create repository and click finish. - This will create a local git repo. (Assuming you already have git installed )

  3. Right click on project -> Team -> Commit - Select only the files you want to commit and click on Commit. - Now the files are committed to your local repo.

  4. Go to git repositories view in eclipse ( or Team -> Show in repositories View)

  5. Expand the git repo of your project and Right click on Remotes -> Create Remote

  6. Remote name will appear as origin, select 'Configure Push' Option and click ok

  7. In the next dialog, click on change next to URI textbox and give your git url, username, password and click on 'Save and Push'. This configures git Push.

  8. For configuring Fetch, go to Git Repositories -> Remote -> Configure Fetch -> Add -> Master Branch -> Next -> Finish -> Save and Fetch

  9. For configuring Master Branch, Branch -> Local -> Master Branch -> Right click and configure branch -> Remote: origin and Upstream Branch : refs/heads/master -> click ok

On refreshing your repo, you will be able to see the files you committed and you can do push and pull from repo.


You need a git client to upload your project to git servers. For eclipse EGIT is a nice plugin to use GIT.

to learn the basic of git , see here // i think you should have the basic first


For eclipse i think EGIT is the best option. This guide http://rogerdudler.github.io/git-guide/index.html will help you understand git quick.


Many of these answers mention how to share the project on Git, which is easy, you just share the code on git, but one thing to take note of is that there is no apparent "project file" that the end user can double click on. Instead you have to use Import->General->Existing project and select the whole folder