1

What is the git command equivalent of this Visual Studio check box?

I though it is git checkout --track but the label suggests domething diffrent.

enter image description here

Allan Xu
  • 6,576
  • 7
  • 38
  • 85

2 Answers2

1

Run git branch -u origin/master after running git checkout -b

The full command is git branch --set-upstream-to origin/master.

See also:

jessehouwing
  • 96,701
  • 20
  • 235
  • 310
-1

If I am understanding it correctly, you are trying to checkout a branch other than master. For that the command should be - git checkout [branchName]

Sourabh Roy
  • 101
  • 9
  • this is the UI that creates a branch. I think you are misunderestanding the checkbox I pointed at. – Allan Xu Jan 16 '20 at 21:52
  • Okay. I may not be following what you are trying to achieve? I thought you are trying to checkout a branch from git and you are looking for a command. Please let me know if my understanding is not correct. Thanks – Sourabh Roy Jan 16 '20 at 21:55
  • The UI I posted comes from Visual Studio 2019 Git UI. That particular VS UI dialog creates a new branch. I am trying to deeper underestand what the UI does, bu learning its commandline equivalent. – Allan Xu Jan 16 '20 at 21:58
  • okay followed. so for this your git command should be git checkout --track origin/my_branch – Sourabh Roy Jan 16 '20 at 22:04
  • Actually, I think it relates to `git branch --set-upstream-to` – Allan Xu Jan 16 '20 at 22:08