SQL Developer’s Interface for GIT: Interacting with a GitHub Repository Part 1Posted: April 9, 2014
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.
The content of the file is a PL/SQL procedure that prints a message.
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.
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 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.
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.
Now the changes should have been applied to the local repository.
We can go to the path where the local repository is located and confirm that sp_test_git.pls is there.