Blog Post

Git Push in SQL Source Control

,

I’m excited. Git support is growing in SQL Source Control and the release recently contains Git push/pull support. If you don’t see the release of 4.1.x, you need to update. The update should be available for everyone.

I do like Git. I’m working with SVN, TFS, and Git on a regular basis. However I tend to prefer Git overall. Now I can do most things I want to do in SOC, which is exciting. No forgetting to push or the need to drop to the command line or another interface.

The Git Additions

In a previous post, I set up a link between a database and a Git repository. Let’s see how the Git push now works.

I’ve got this database on my local instance.

soc_git_push_2

It’s linked with SQL Source Control to a local Git repository.

soc_git_push_3

Let’s change something. I’ll pop open a stored proc.

soc_git_push_4

Let’s a simple, but real, change. I’ll add a NOCOUNT setting in there, which is a good idea.

soc_git_push_5

In the Commit tab for SQL Source Control, I see my change. Note that most everything looks the same here and I can see the code differences like I always could.

soc_git_push_6

Now I commit this change. In this case, it goes to my local Git repo, but isn’t pushed.

NOTE: In the real world, I’d pull before I commit to be sure I wasn’t causing a merge issue.

Once that’s done, my Commit tab changes.

soc_git_push_7

SQL Source Control (SOC) detects the change and knows we have an unsynced Git repo. I can now push the “Push” button. Once I do this, I get a warning if I haven’t turned this off. I turn it off, but you should always be aware that SOC isn’t managing your Git repo. It’s linking to it. If you make changes in the repo with some other app, like Visual Studio, the entire repo is pushed, not just the change SOC committed.

soc_git_push_8

Once this is done, I once again see a clean Commit tab.

soc_git_push_1

However, if I go to the remote repo, which is on GitHub in this case, I see my change.

soc_git_push_9

I love Git. I think it’s really cool, and it’s a great way to work with distributed Version Control. I am playing with TFS as well, but I prefer Git, and I think this support is great.

There are still things needed, things I want, and more, so be sure you add your votes to the SQL Source Control UserVoice page and let the SOC team know what’s important to you.

Filed under: Blog Tagged: Git, Redgate, SQL Source Control, syndicated, version control

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating