代码之家  ›  专栏  ›  技术社区  ›  Zac

git签出<branch><file path>与<branch>上的内容不匹配

  •  1
  • Zac  · 技术社区  · 3 年前

    git

    main/development UsersTable.tsx

    chore/add-linting

    $ git pull origin main/development
    
    # oh no, I have a couple merge conflicts
    
    # I want this file to be whatever is exactly on `main/development`
    $ git checkout main/development path/to/UsersTable.tsx
    
    Updated 1 path from f59fed63
    

    git fetch git pull

    1 回复  |  直到 3 年前
        1
  •  1
  •   VonC    3 年前

    git restore old and confusing git checkout

    git fetch
    git restore -SW -s origin/main/development -- path/to/UsersTable.tsx
    

    origin/main/development chore/add-linting