Skip to content

Git: Errors when staging changes in new repository #82026

Closed

Description

@cdoublev
  • VSCode Version: 1.38.1
  • OS Version: Windows 10 v1903

Steps to Reproduce:

  1. Add a folder in workspace
  2. Init a git repository in this folder
  3. Create a new file in this folder
  4. Stage change from the source control providers (scp) panel
  5. Append/change content in the file
  6. Stage change by using the blue icon in the left gutter (not from scp panel)

An error (OS) window pops up with the message "Git fatal: Not a valid object name HEAD".

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

Activity

  1. joaomoreno commented on Oct 10, 2019

    @joaomoreno
    Contributor

    I don't even see a gutter decoration.

  2. added
    bug
    git
    on Oct 10, 2019
  3. added
    help wanted
    on Oct 10, 2019
  4. changed the title [-]Git stage changes in new repository[/-] [+]Errors when staging changes in new repository[/+] on Oct 10, 2019
  5. changed the title [-]Errors when staging changes in new repository[/-] [+]Git: Errors when staging changes in new repository[/+] on Oct 10, 2019
  6. cdoublev commented on Oct 10, 2019

    @cdoublev
    Author

    Thank you for looking at this. It seems that the file needs to have an extension in order to have the gutter indicators from git.

    Hop this might help: https://gifyu.com/image/klDH

  7. added a commit that references this issue on Oct 21, 2019
    7b1a6c8
  8. anirudhrb commented on Oct 21, 2019

    @anirudhrb
    Contributor

    Since the repo is empty, there is no HEAD. That's what causes the error. I have attempted a PR (#82995). João Moreno (@joaomoreno) please have a look.

  9. locked and limited conversation to collaborators on Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buggithelp wantedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions