How do I solve a Git checkout error: updating paths is incompatible with switching branches?

0 votes

I’m trying to fetch a remote branch by running the following command:

git checkout -b local-name origin/remote-name

But this leads to the following error:

fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/remote-name' which can not be resolved as commit?

Jul 26, 2018 in Git & GitHub by Tyrion anex
• 8,270 points
598 views

1 answer to this question.

0 votes

This error occurs when you are checking out a remote branch that your local git repo is unaware of. To solve this, run:

git remote show origin

If the remote branch you are trying to checkout is specified under "New remote branches" and not under "Tracked remote branches" then you have to fetch the branch first, follow the below commands:

git remote update
git fetch

Now try:

git checkout -b local-name origin/remote-name
answered Jul 26, 2018 by Sophie may
• 9,530 points

Related Questions In Git & GitHub

0 votes
1 answer

How to solve the ‘Git commit -a error’?

This happens when no editor is set. ...READ MORE

answered Jul 5, 2018 in Git & GitHub by Tyrion anex
• 8,270 points
58 views
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,810 points
135 views
0 votes
1 answer
0 votes
1 answer

How do I install Git on windows?

Hey @Akash, follow these steps: Go to this ...READ MORE

answered Feb 19 in Git & GitHub by Nikhil
49 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
152 views
0 votes
1 answer
0 votes
1 answer

How to forcefully commit a file to Git even if the file is ruled as unchanged?

This is simple, just follow the below ...READ MORE

answered Jul 11, 2018 in Git & GitHub by Sophie may
• 9,530 points
37 views
0 votes
2 answers

How to view the nested workflow of a local git repository?

The closest way to view branches in ...READ MORE

answered Aug 2 in Git & GitHub by Sirajul
• 25,700 points
66 views