Home > other >  Does someone had a problem while checking in git ( git status ) and had a error like this?
Does someone had a problem while checking in git ( git status ) and had a error like this?

Time:10-06

Why while trying to test my repositories, and typing git status it gives me this reply:

  .VirtualBox/
    .bash_history
    .git-for-windows-updater
    .gitconfig
    .idlerc/
    .lesshst
    .vscode/
    3D Objects/
    AppData/
    Contacts/
    Downloads/
    Favorites/
    Links/
    Moon/
    Moonlight/
    Music/
    NTUSER.DAT
    NTUSER.DAT{53b39e87-18c4-11ea-a811-000d3aa4692b}.TxR.0.regtrans-ms
    NTUSER.DAT{53b39e87-18c4-11ea-a811-000d3aa4692b}.TxR.1.regtrans-ms
    NTUSER.DAT{53b39e87-18c4-11ea-a811-000d3aa4692b}.TxR.2.regtrans-ms
    NTUSER.DAT{53b39e87-18c4-11ea-a811-000d3aa4692b}.TxR.blf
    NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TM.blf
    NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000001.regtrans-ms
    NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000002.regtrans-ms
    OneDrive/
    PycharmProjects/
    Saved Games/
    Searches/
    Videos/
    VirtualBox VMs/
    ntuser.dat.LOG1
    ntuser.dat.LOG2
    ntuser.ini
    php
    test/

I also tried running git add . and it gives the same output.

CodePudding user response:

It looks like something initialized a repo in your userprofile on windows. You may have executed git init in the wrong terminal window or folder.

CodePudding user response:

Either you must have git init in wrong directory than your root project as mentioned by jessehouwing or your git files are corrupt

do this only after taking proper backup of your current project by moving or copying to another location,

  1. Now what you can do is try deleting your .git files from earlier where you might have initiated the git by git init command and then again properly re-initiate git with git init from your desired root project,
  2. Next run git add .
  3. Now to check whether desired files are staged for commit run git status it will list all the files which are staged for commit
  4. then commit your message by firing this git commit -m "message here for commit"
  5. To push your local repository to remote branch you nee to run below two commands from your desired root project directory,
git remote add origin 'your commit message'
git push -u origin main 
  • Related