Git issue: Cannot update paths and switch to branch ' Dev ' at the same time.

Source: Internet
Author: User
Tags reset

The following error occurred while creating the remote branch:

$ git checkout-b dev origin/dev

fatal:cannot update paths and switch to branch ' Dev ' at the same time.
Did you intend to checkout ' origin/dev ' which can isn't be resolved as commit?

Internet search a lot of information can not solve, finally to the StackOverflow found the answer: link

Translation: (Do not spray)

As I mentioned in "Get new upstream branch with Git," you can try the following command:

# Let's create a new local branch first
# Let's create a new local branch
git checkout-b iss53
# then reset its starting point# then reset its starting point
git reset--hard origin/iss53 

Make sure that the original trace of the branch origin/iss53 to exist after running the GIT Fetch Origin command.

Origin/iss53 means that the origin index of the remote repository has a ISS53 branch.

If there is no ORIGIN/ISS53 branch in the original repository, you can simply create a local branch iss53 and then push it to the remote repository:

 

This creates a connection between the local branch iss53 and the branch origin/iss53 of the original trace.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.