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

6 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.


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.