What are the challenges you face when working across database platforms? Take the survey
Options

SQL Source Control, GIT and Visual Studio Online

Is there a step by step document that walks through how to set up SQL Source Control with GIT and then push to Visual Studio Online? I have GIT configured to synch with Visual Studio Online. That works just fine from the file system using the Tortoise GIT client. I have SQL Source Control configured to use GIT, and that seems to work fine as well. I get a message in SQL Source Control that I need to push the change, but then I get a Source Control Credentials required dialog box. I put in my VSO credentials, but it never authenticates. Again, I can push to VSO from the file system using the Tortoise GIT client.

Versions:
SQL Source Control: 5.7.6.6321
GIT: 2.14.1
Tortoise GIT: 2.5.0.0

Thanks
Henry Winkler

Answers

  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    Command line.

    > git push

    I know.
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
  • Options
    Just so I'm clear - there's no way to do this via the SQL Source Control UI?

    I'm assuming your "I know" comment was intended to head off any screams of disbelief/frustration.
  • Options
    Maybe I should ask a different question - is there a way to configure SQL Source Control to synch with Visual Studio Online directly? I don't have to have GIT in the middle if I don't need to.
  • Options
    Hi @HWinkler

    Can you please try:
    1- create a Personal access token https://docs.microsoft.com/en-us/vsts/accounts/use-personal-access-tokens-to-authenticate
    2- clone the repository to your PC (manual clone or via VS)

    q41a6al27l73.png

    2- Click the database, go to Set up in SQL Source Control --Link to my source control system -- Git, paste the path of the local repository that you've cloned.

    6vgsgqod9trw.png

    3- Click 'Link', and choose access token and put in your Personal access token.
    SQL Source Control will remember the token so you don't need to re-enter it in the case of relinking.

    I hope this helps. Please let me know if you need more information.

    Thanks.

    Kind regards

    Tianjiao Li | Redgate Software
    Have you visited our Help Center?
  • Options
    Shaun5StuShaun5Stu Posts: 1 New member
    Tianjiao - does this actually work with SQL Source control version 5.7.6.6321? That is the version the OP had and what I have, but my screen for linking the database is different and does not give me an option to use a personal access token.
  • Options
    Hi @Shaun5Stu

    Sorry I should have been more clearer. You won't be prompted Access Token request until you try to Push or Pull from remote.

    For example:


    After click Continue, you'll need to use Access token to complete the Push.


    Kind regards

    Tianjiao Li | Redgate Software
    Have you visited our Help Center?
  • Options
    I have the same issue.  Using the Git Push in Powershell is works. When I use the Access Token it fails very fast... Almost too fast.  Makes me wonder if its even trying.  I also tried using the Username and password which I created the VSTS (Azure DevOps) repository with... No luck
  • Options
    Oddly the Pull from remote repository works so I assume all my credentials are good and the Push has a bug
  • Options
    SinisterPenguinSinisterPenguin Posts: 4 New member
    edited November 14, 2018 12:11PM
    Same issue here, any more feedback on this one? Is it confirmed as a bug? am I doing something dumb? 

    ....Update - looks like I am doing something dumb. Though it would be MEGA helpful if SQL Source Control gave you the FULL error message & not just a simple 403.
  • Options
    I'm trying to get SSC (v7.0.6.8775) set-up to push to an Azure DevOps git repo. I have linked the repo successfully and committed changes but when I try to push changes I get to the same Continue button as per the first screenshot from @Tianjiao_Li but never get an option to add credentials and just get an authentication failure message. Any ideas as to how to solve this? I have previously been successfully committing to a TFS git repo through a git command line.
  • Options
    SQL Source Control 7 now uses the Git command line for all its operations. Have you been able to push successfully using the command line?
    Development Lead
    Redgate Software
  • Options
    Mike U said:
    SQL Source Control 7 now uses the Git command line for all its operations. Have you been able to push successfully using the command line?

    Hi Mike, yes, I've been able to push successfully using the command line.
  • Options
    Are you prompted for any credentials while pushing from the command line? You may need to modify the relevant git.config so that it remembers credentials.
    Development Lead
    Redgate Software
Sign In or Register to comment.