Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change remote HEAD branch in git hosted on visual studio online

When People clone this specific visual studio online repo, instead of getting the expected master branch, they're getting a branch called initial.

I would like the branch called master to be the default branch that gets checked-out when cloning the repository.

Indeed, when running git branch -a i'm getting the following result:

remotes/origin/HEAD -> origin/initial
remotes/origin/initial
remotes/origin/master

Which basically confirms that HEAD points to initial.

Also note that I do not have direct access to the remote file system (as it's hosted on visual studio online).

In github.com it's possible via the web portal, but I didn't find a similar option in visual studio online.

How can i change the remote repository to the following state?

remotes/origin/HEAD -> origin/master
like image 509
rony l Avatar asked Oct 02 '14 17:10

rony l


People also ask

How do I switch to remote branch in Visual Studio?

First, right click on the remote branch, and select New Local Branch From on the context menu, just as if you were creating any other branch. The Create Branch window section will appear. Note how Visual Studio auto-populates the name of the local branch as `for-review` You could change the local branch name.

How do I change the default branch in Visual Studio?

Change default branch, you can navigate to Repos>Branches>Ellipsis button> Set as default branch button.


1 Answers

In Web Access, navigate to the repository in question. In the repository drop-down, select "Manage repositories...":

Manage repositories

On the left side of the repository management page, you can expand the repository to see the branches. Select the branch you want to make the default branch, right-click and select "Set as default branch".

Set as default branch

like image 148
Edward Thomson Avatar answered Oct 01 '22 16:10

Edward Thomson