9 Replies Latest reply on Nov 1, 2017 6:55 PM by 205b7e6a-35da-42e1-91b6-f4dbb0b2c931

    SQL Developer and GIT




      I wonder if someone could point me towards some documentation on how to use Git with SQL Developer?


      There's some explanations of menu commands in the application help, but nothing that really explains how to use it.


      There are some blog entries on the internet.  But surely there is some in-depth explanation of how to use this feature from the SQL developer team?


      My problem is this :  I am using SQL Developer 4.1.3.


      I've created a Github repository.  And using the URL from that, I've been able to connect to it from inside SQL developer, and to pull files from it.


      The next step is that I want to add files to that repository.


      When I add the file in SQL developer, and then go to Commit it, I get the following error :



        at oracle.ide.net.URLFactory.newURL(URLFactory.java:121)

        at oracle.jdevimpl.vcs.git.GITConfig.getUsers(GITConfig.java:55)

        at oracle.jdevimpl.vcs.git.GITUtil.getUserList(GITUtil.java:644)

        at oracle.jdevimpl.vcs.git.cmd.GITOperationCommit.createOptionsCustomizer(GITOperationCommit.java:500)

        at oracle.jdevimpl.vcs.git.cmd.GITAbstractOperation.invokeCommand(GITAbstractOperation.java:194)

        at oracle.jdeveloper.vcs.generic.ActionCommand.doitImplInvoke(ActionCommand.java:250)

        at oracle.jdevimpl.vcs.git.cmd.GITOperationCommit.doitImpl(GITOperationCommit.java:290)

        at oracle.jdeveloper.vcs.generic.ActionCommand.doitImpl(ActionCommand.java:199)

        at oracle.jdeveloper.vcs.spi.VCSCommand.doit3(VCSCommand.java:600)

        at oracle.jdeveloper.vcs.spi.VCSCommand.doit(VCSCommand.java:135)

        at oracle.ide.controller.CommandProcessor.invoke(CommandProcessor.java:377)

        at oracle.jdeveloper.vcs.spi.VCSController.invokeCommand(VCSController.java:205)

        at oracle.jdeveloper.vcs.spi.VCSController.handleEventImpl(VCSController.java:160)

        at oracle.jdeveloper.vcs.spi.VCSController$1.run(VCSController.java:87)

        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)

        at java.awt.EventQueue.access$500(EventQueue.java:97)

        at java.awt.EventQueue$3.run(EventQueue.java:709)

        at java.awt.EventQueue$3.run(EventQueue.java:703)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)

        at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)

        at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)

        at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)




      Paul Stuart

        • 1. Re: SQL Developer and GIT
          Mike Kutz

          I always:

          1. cloned a copy of the repository to local HD
          2. do some work
          3. Commit the local
          4. GOTO step 2 until ready for release
          5. Sync with GitHub.


          But, that may be me.


          My $0.02



          1 person found this helpful
          • 2. Re: SQL Developer and GIT

            Thanks Mike.  I've been able to make some progress with it.  But some of the errors I get when using the Git functionality haven't gone away, so I've logged an SR about.




            Paul Stuart

            • 3. Re: SQL Developer and GIT

              Here is the outcome.  Apparently, this is a known bug.  The workaround is to open the local git repository via the SQL Developer file navigator.

              • 4. Re: SQL Developer and GIT

                Could you please explain how to open the git repository in that way.

                Which file do you open?




                • 5. Re: SQL Developer and GIT
                  Antonio Carlos Pérez León

                  I have the same problem, i have solved this opening one file with SQLDEV filesystem, but now i cant commit or merge, this is the error :



                      at org.eclipse.jgit.lib.Repository.resolve(Repository.java:425)

                      at org.eclipse.jgit.lib.Repository.resolve(Repository.java:384)

                      at org.netbeans.libs.git.jgit.Utils.parseObjectId(Utils.java:287)

                      at org.netbeans.libs.git.jgit.Utils.findCommit(Utils.java:266)

                      at org.netbeans.libs.git.jgit.Utils.findCommit(Utils.java:262)

                      at org.netbeans.libs.git.jgit.commands.MergeCommand.run(MergeCommand.java:90)

                      at org.netbeans.libs.git.jgit.commands.GitCommand$1.run(GitCommand.java:80)

                      at org.netbeans.libs.git.jgit.commands.GitCommand$1.run(GitCommand.java:77)

                      at java.security.AccessController.doPrivileged(Native Method)

                      at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:77)

                      at org.netbeans.libs.git.GitClient.merge(GitClient.java:1020)

                      at org.netbeans.libs.git.GitClient.merge(GitClient.java:1004)

                      at oracle.jdevimpl.vcs.git.cmd.GITOperationMerge.merge(GITOperationMerge.java:189)

                      at oracle.jdevimpl.vcs.git.cmd.GITOperationMerge.invokeCommandImpl(GITOperationMerge.java:161)

                      at oracle.jdevimpl.vcs.git.cmd.GITAbstractOperation$1.doCommitOperation(GITAbstractOperation.java:211)

                      at oracle.jdeveloper.vcs.spi.VCSDialogCommitter$1.run(VCSDialogCommitter.java:83)


                  HELP plis, Thanks!

                  • 6. Re: SQL Developer and GIT

                    While browsing I was looking for solution for similar issue i.e. from SQL Developer I tried to commit the changes. It ended in same nullPointer exception.

                    It would be great if someone got any clue or workaround and can share their thoughts.

                    • 7. Re: SQL Developer and GIT
                      Dorian Grim

                      Do you have this issue still? Today I managed to get it working.

                      • 9. Re: SQL Developer and GIT

                        TL; DR version: my version of sql developer appears to have been the issue, updating to 17.3.1 resolved my issue and I was able to sync my local git repo to my remote repo. Note, as I mentioned below, when I updated my sql developer install, I did not import any preferences from my initial sql developer install, not sure if that matters one way or the other.


                        I ran into the same issue myself today trying to get git to work. As a bit of a refresher so others understand what I was experiencing, which is similar to the issue described above. I was able to clone a remote repo from github to a local directory on my machine but I could not compare/push the local git directory to the remote repo directory**.


                        Similar to what everyone else mentioned, when I attempted to evaluate my local git repo against my repo on github, I would receive an error, that was unclear (NullPointer...; don't recall the wording but is similar to what everyone else mentioned above). After 40 minutes of troubleshooting, I ran across a comment on a board somewhere (sorry, don't recall where) that mentioned that the issue may be a bug versus a setup issue within sql developer, which if the case is good since it wasn't me, but a pain since it means updating my installation of sql developer. Well sure enough, it appears that was the case; this morning I downloaded and installed SQL Developer 17.3.1--note I didn't import any preferences from my existing install of sql developer which means I cannot comment as to whether that played a role in any way--and followed the steps to set up a git with versioning I was able to both compare my local repo against the master branch as well as push changes from my local repo to the remote repo.


                        Hope this helps, if not let me know


                        **Note this took a bit of work to get this up and running, though I will presume that if you are reading this 1) you have successfully cloned a remote repo to your machine and 2) are able to locate git directory on your machine, if you haven't done that, you'll want to check out out these articles (SQL Developer’s Interface for GIT: Cloning a GitHub Repository, SQL Developer’s Interface for GIT: Interacting with a GitHub Repository Part 1 , and SQL Developer’s Interface for GIT: Interacting with a GitHub Repository Part 2) this are informative and did end up help me getting everything up and running.