1

Currently while trying to create a new branch and setting up tracking at the same time I'm getting the following error. Note that co is aliased to checkout

git co -b feature/validation --track fork/feature/validation

Error

fatal: Cannot update paths and switch to branch 'feature/validation' at the same time. Did you intend to checkout 'fork/feature/validation' which can not be resolved a s commit?

Note I'm using Msysgit

Andremoniy
  • 34,031
  • 20
  • 135
  • 241
ndrone
  • 3,524
  • 2
  • 23
  • 37

1 Answers1

2

Use either -b or --track options. Do not use them simultaneously, as both have similar functionality.

git checkout -b feature/validation fork/feature/validation

or

git checkout --track fork/feature/validation

will have have same output i.e. create feature/validation branch which tracks tracks remote branch feature/validation. The first approach gives you the flexibility of having a local branch which tracks remote branch with different name. Second one is a shorthand approach which sets up local and remote branch with same names. Use the one which suits your needs.

Aditya Kadakia
  • 1,359
  • 9
  • 10