SQL Developer’s Interface for GIT: Interacting with a GitHub Repository Part 1

In my previous post, I showed how to clone a GitHub repository using SQL Developer. In this post I’m going to show to synchronize the remote and local repositories after remote gets modified.

Here I use GitHub to commit a file called sp_test_git.pls.  You can create files by clicking on the icon the red arrow is pointing to.

new_file

The content of the file is a PL/SQL procedure that prints a message.

file_content

At this point, the remote repository and the local repository are out of sync. The first thing that you may want to do before modifying any repository, is to make sure that you have the most current version of it so that it includes the changes made by other developers. Let’s synchronize remote and local.

Make sure you open the Versions window. Go to the main menu click on Team -> Versions.

versions

Open the Local branch and click on master, then go to main menu click on Team -> Git -> Fetch to open the “Fetch from Git” wizard. Fetching a repository copies changes from the remote repository into your local system, without modifying any of your current branches. Once you have fetched the changes, you can merge them into your branches or simply view them. We can see the changes on the Branch Compare window by going to the main menu click on Team -> Git -> Branch Compare.

branch_compare

 Branch Compare is showing that sp_test_git.pls has been fetched from the remote master branch. We can right click on this entry and select compare to see the differences.

compare

The window on the left displays the content of the fetched file and the window on right displays the content of the same file in the local repository. In this case the right windows is empty because this is a brand new file that doesn’t exist locally. Let’s accept the changes and merge them into the local repository. We go to the Branch Compare window, right click on the entry, select merge and click on the “Ok” button.

merge

Now the changes should have been applied to the local repository.

local_update

We can go to the path where the local repository is located and confirm that sp_test_git.pls is there.

 

 

About these ads

10 Comments on “SQL Developer’s Interface for GIT: Interacting with a GitHub Repository Part 1”

  1. Jay says:

    Thanks for the excellent walk-through. All seems to work okay for me until I try to view my Git repository in SQL Developer (4.0.2). When I oopen the Versions panel I see the Git icon but nothing below it. The local repository was created without incident when I walked through the steps as you outlined above. Any ideas?

    • gbalda says:

      Jay,

      Thanks for stopping by. I haven’t upgraded to 4.0.2 yet but what happens if you open any of the files (using SQL Developer of course) that are in your local repository?

      • Jay says:

        Actually, in the Versions window I do not see anything below the “Git” icon. I cannot expand it to see even the local repository. It was the same when using version 4.0.1. (Note: I am using the 64-bit Windows version of SQL Developer. Any known issues with the 64-bit version and Git?)

      • gbalda says:

        That sounds like a bug. I’m checking with the SQL Developer PM. Can you open a file that’s in the repository using the “open file dialog” and see if that activates the git tree on the versions window?

  2. Jay says:

    I tried that and no luck. I’ll keep looking at it and thanks for checking it with the SQL Developer PM.

  3. I am experiencing the exact same problem as described by Jay. Am using SQL Developer Version 4.0.2.15 build 15.21 on 62 bit Win 7 Pro. In the “Team….Versions” window it shows the Git icon, but unable to expand it. Right clicking on “Git” icon in “Versions” window only shows “Clone…”, “New…”, and “Connection to Subversion”.
    I tried opening a file that’s part of the local git repo, but it had no effect. Also tried closing and opening SQL Developer, but it has no effect.
    I went to the URL to the OTN Forums you provided to Jay, logged in, located your post of the git version issue, “Liked” your post there and gave it 5 stars.
    When I installed SQL Developer 4, I declined the offer to migrate settings from SQL Developer 3. You mentioned in one of your other posts that you needed to decline in order to get the git to work. It did not help in my case.

    • gbalda says:

      Do you see any errors in the log panel? This is what happened to me when I upgraded from v3 to v4 https://community.oracle.com/message/12400926#12400926

      I kept upgrading SQL Developer without issues (v 4.0.2.15 Build 15.21 currently) and everything was fine until one day when the GIT functionality stopped working again. I’m not sure what happened but I suspect the java 7 update 55 may have something to do with it because it’s the only thing that has changed on my pc. I haven’t done any testing to confirm/deny this idea.

      • I fixed this problem by doing the following. I don’t know if any of these steps were unnecessary, I just know that “Versions Git” works after doing all of them:
        1) Uninstall SQL Developer 3
        2) Uninstall SQL Developer 4
        3) Delete entire contents of C:\Users\rdgjr\AppData\Roaming\sqldeveloper
        4) Delete entire contents of C:\Users\rdgjr\AppData\Roaming\SQL Developer
        5) Re-install SQL Developer 4 ( Version 4.0.2.15 Build 15.21)
        6) Team…Git Clone…. etc
        7) Manually open file in local Git repo via File….Open
        8) Team…Versions
        10) Expand the “Git” icon

  4. I created a new git bug report in the Oracle OTN and included screenshots: https://community.oracle.com/message/12583505#12583505
    It could help to get attention to this bug if readers could “like” it there.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.