3

In the Commit tab, the branch shown is a grey master.

enter image description here

In my GitHub, I have already set up a develop branch and hope to commit my changes to that branch. How can I change the working branch in RedGate SQL Source Control?

Blaise
  • 21,314
  • 28
  • 108
  • 169

2 Answers2

3

You can't do branch switching within SQL Source Control, at least not yet. For now you have to use an external client such as the Git command line.

Eg, git checkout yourbranch

After you do this you will need to update your database by going to the get latest tab in SQL Source Control.

David Atkinson
  • 5,759
  • 2
  • 28
  • 35
1

Based on David Atkinson's answer, I gave up doing branch switching within SQL Source Control.

Here is what I did.

  1. Clone the git,
git clone ...

At this moment, there is only one master branch in the local git repository.

git branch -l

But the develop branch can be seen in remotes/origin/develop

git branch -a
  1. Copy the develop branch from remote to local repository.
git branch -c develop
git branch -l

Now we will see both develop and master branches in local repository.

  1. switch to develop branch in local repository
git switch develop
git branch -l
  1. Unlink database in SQL Source Control and Link database to SQL Source Control again. success

Now the branch in SQL Source Control is develop. It is greyed and cannot be changed to other branch.

That is my "solution" in the year of 2020. Let's hope RedGate can provide a easier way to switch branch in the future.

Blaise
  • 21,314
  • 28
  • 108
  • 169