Git Working Directory for Eclipse Workspace

I built my maven projects in my spring toolkit and now decided that I need to do some version control.

I went to GIT and used the command line client to create a local repository.

So, I have a local repo - which is ready to implement version control and the workspace with file uploads.

I am using the GIT plugin for Eclipse. See image below.

enter image description here

How can I somehow synchronize my workspace with the GIT working directory so that I can start executing and fixing indexes on Github?

Many thanks

// ** EDIT ** //

Ok - found this blog

I realized that this is just a project project-> team-> share project in the context menu of the Eclipse project.

thanks

+6
source share
1 answer

This blog post (from Lucas Piva Rocha Corrica ) is more about the step you need to follow to share your local git project on GitHub;

  • which includes the "Collective Share" you found
  • but he also mentions the ssh settings that you need to get in order to be able to click on the https GitHub address.

Configure Eclipse

  • Go to Windows -> Preferences and filter out SSH. Select SSH2 on the left tab (should be under General β†’ Network Connections).
  • Make sure that the SSH2 home is set to /home/<yourusername>/.ssh , and id_rsa is in private keys.
  • On the Key Management tab, click Load Existing Key ... and select the id_rsa (private) key in ~/.ssh/id_rsa . If your key has a non-empty passphrase, eclipse will not be able to download it, even if you provide the correct password.
  • Now just save it in the same place where you downloaded it, confirm the empty passphrase, overwrite it, apply it and click OK.

Pushing your project to the github repository

The final step is to push the project to a remote repository on github.

  • Finally, select the project that you want to click on the created repository, right-click it, go to Team -> Share Project ... and select git .
  • Select your project, click Create Repository and Finish. Now you can commit and update the changes to the local git repository.
  • To redirect it to a remote GitHub repository, right-click your project, select Team -> Remote -> Push ...
  • Fill in the URI with your project's SSH address, which appears when you enter your repository page on GitHub.
  • Select ssh protocol , git user and blank password.
  • Cross your fingers, click next. If for some reason this does not work, try restarting Eclipse (it worked for me after the restart).
  • Select the Ref source link and destination (basically a branch), click "Add BOM" and "Finish" on the next screen.
  • I hope all will be ok.
+4
source

Source: https://habr.com/ru/post/906537/


All Articles