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
  • 7,998
  • 11
  • 51
  • 122

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
  • 106,458
  • 22
  • 256
  • 341
-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
  • 159
  • 1
  • 18
  • 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