Change not recognized in one direction "Get Latest", but not the other direction "Commit"

TerryOTerryO Posts: 4 New member
edited May 2, 2018 5:45PM in SQL Source Control
Had a situation where a hot fix change went into production database. but not updated in source control.  Thought I'd sync source control from the production database .via "Commit" compare, with SQL Source control but the result was "No objects with changes to be committed to source control".  Then hit refresh and received same No objects message. Clicked on "Get Latest" and the change is detected....but this is the wrong direction.  I do not want to overlay the production database change with the code from source control. So, then  go to "Commit" and still "No objects with changes to be committed to source control".   I close SSMS and start this whole process over again. Finally, I give up and I manually update the code in my local repository with the change and push it up to the remote.  I then go back to SQL Source Control window "Get Latest" then "Pull from remote repository" and hit refresh and now source control is in sync.  Any ideas what is going on here?  Are there any files in the "user\appdate\local\Redgate\SQL Source Control 6" subdirectories that can be deleted to remedy this situation?

Answers

  • JoelIJoelI Posts: 1 New member
    Any replies or solutions for this by now, apart from hacking the code in yourself? We have the same issue, resulting in not having the entire release on our production environment, which we only found out cause one of the users reported missing data. We have changes on our DEV environment compared to our GIT version, but for some reason on the commit tab they dont show and it looks like everything is up-to-date. On the get-latest tab the differences show, but I dont want them to rollback, I want to check them in :(

    Version: 5.0.1.2528
  • JustinLJustinL Posts: 1 New member
    In my case, I made a commit (which I hadn't pushed yet) that I needed to undo. I used the Git CLI to undo the commit, but I wasn't able to get those changes to appear in the "Commit" tab, even after I removed the changed .sql files. Here's what I had to do:

    1. Go to the Setup tab and click to open the working base folder.
    2. Undo the SQL Source Control commits back to the time before I committed and remove the changed files.
    3. Refresh the "Commit" tab.

    What happened for me was that because SQL Source Control doesn't give you a way to undo a commit, it's own working copy still had that commit, and therefore wouldn't show any changes. If your changes weren't at some point committed, I'm not sure if this will work for you, but hopefully it'll help point you in the right direction.

    This may also help: https://documentation.red-gate.com/soc5/reference-information/how-sql-source-control-works-behind-the-scenes
  • jerreckjerreck Posts: 1 New member
    I managed to resolve this by un-linking the database from source control and then re-linking it.
  • Oinodelec31Oinodelec31 Posts: 4 New member
    @jerreck are you using Shared or Dedicated mode?
Sign In or Register to comment.