Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: difference "create branch" and "create branch from"

Tags:

When trying to create a new branch, from an existing one, I'm faced with these two options:

  1. + Create branch...
  2. + Create branch from...

I don't really understand the difference between these two options.

like image 462
ted Avatar asked Jan 22 '20 14:01

ted


People also ask

What is create new branch from in VSCode?

Task 1: Creating a new branch in your local repository Return to Visual Studio Code. Click the master branch from the bottom left. Select Create new branch from…. Enter the name “dev” for the new branch and press Enter. Select the master as the reference branch.

What is create new branch from?

New Branches The git branch command can be used to create a new branch. When you want to start a new feature, you create a new branch off main using git branch new_branch . Once created you can then use git checkout new_branch to switch to that branch.


2 Answers

Both commands are used to create new branches and switch to the branch after successfully created. But

  1. + Create branch... will create a new branch from the current branch you are working on.
  2. + Create branch from... will create a new branch from some other branch in the git repository.
like image 134
Sunil Chaudhary Avatar answered Oct 09 '22 05:10

Sunil Chaudhary


I would guess the first creates a branch from the point you are working from at the time... on the other one, you specify where from.

like image 30
eftshift0 Avatar answered Oct 09 '22 06:10

eftshift0