Microsoft/vscode

Git - Branch on new local repo fails

Open

#200 773 ouverte le 13 déc. 2023

Voir sur GitHub
 (1 commentaire) (0 réactions) (1 assigné)TypeScript (10 221 forks)batch import
buggithelp wanted

Métriques du dépôt

Stars
 (74 848 stars)
Métriques de merge PR
 (Merge moyen 11h 43m) (1 000 PRs mergées en 30 j)

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.85.0 (user setup) commit af28b32d7
  • OS Version: Windows_NT x64 10.0.22621

Steps to Reproduce:

  1. Create new folder and enter folder: mkdir test1 && cd test1

  2. Open vscode: `code . --disable-extensions

  3. Use activity bar to initialize new repo

  4. Create new text file but don't check it in

  5. Use command palette to create new branch Git: Create Branch with name test

  6. Get error - "Error: Git: fatal: Head is not a commit and a branch test cannot be created from it"

    image

  7. Show git command:

    > git checkout -q -b test --no-track HEAD
    fatal: 'HEAD' is not a commit and a branch 'test' cannot be created from it
    
  8. Reproduce branch in terminal: git checkout -b test => success

    image

Guide contributeur