0

I have a Java - Selenium project in eclipse which I have pushed to my git remote repository. I am able to sync the changes by using Team > commit. Then I duplicated the project in Eclipse by copying the project on the package explorer side and pasting it as a duplicate and renamed the project name. How do I push this new project to GIT . Can eclipse create new repository in remote?

brlawrence
  • 19
  • 5
  • Git requires that the remote repository exists. Creating a remote repository differs depending on what you use: GitHub, GitLab, BitBucket, Gitea, etc. The [EGit user guide](https://help.eclipse.org/latest/topic/org.eclipse.egit.doc/help/EGit/User_Guide/User-Guide.html) explains very well what you are asking, doesn't it? Please consider deleting your question as long as you have not read it. – howlger Aug 14 '23 at 08:44
  • I can create a new repository in my gitHub itself. I think the problem is that , when I copied the project in eclipse as a new project , all the internal git files also got copied and so Team >> share is not being shown. Your link to EGit user guide shows the whole manual. I am not sure if you intended to point the URL to the specific scenario being explained , where in an existing project that is already in github was copied over within eclipse and then I am trying to move to GitHub. Can you please clarify? – brlawrence Aug 15 '23 at 02:47

1 Answers1

0

I solved it by deleting the .git hidden folder , gitignore, and readme file from the project root directory. Created the new repository in git hub

Then I did the set of commands we usually do like git init, "git add ." after setting up the gitignore file

brlawrence
  • 19
  • 5
  • This sounds very cumbersome, time-consuming and error-prone. You don't need any of those command line Git commands in Eclipse. – howlger Aug 15 '23 at 07:09
  • I was forced to use git Bash as Eclipse is not allowing me to push as the password is not getting accepted. I tried the token method by generating token and still getting errors, not sure why it had to be made so difficult. It was working very seamlessly – brlawrence Aug 16 '23 at 06:48
  • Nobody forced you. GitHub offer different ways which are all supported by Eclipse, but what you say is too vague (HTTPS or SSH; the password for what; ...) to know which way you exactly chose in order to tell what you did wrong. – howlger Aug 16 '23 at 07:51
  • It is HTTPS. When I use Git Bash and push , it is able to open the GitHub portal, prompt to enter my regular GitHub password and authenticate me to push the code. But through eclipse it does not accept the password. Is there any setting I need to do to allow the regular git hub password ? – brlawrence Aug 16 '23 at 17:28
  • 1
    See https://stackoverflow.com/a/68802292/6505250 – howlger Aug 16 '23 at 17:38
  • Yes, this helped – brlawrence Aug 19 '23 at 06:09