Reinitialized existing Git repository in c:/xampp/htdocs/website/.git/

34,356

Solution 1

If you did push, you can try and:

  • clone again in another folder
  • check that it does look like /c/xampp/htdocs/otherfolder (master)
  • if it does, rename otherfolder to website, and go on working in that fresh clone

Solution 2

Use rd .git /S/Q before running the git init command.

Share:
34,356
mochadwi
Author by

mochadwi

Keep going level up :)

Updated on July 09, 2022

Comments

  • mochadwi
    mochadwi almost 2 years

    I already made a project there, add, commit, push. Unfotunately, I've got power surgery :'(

    When I've tried restart my PC, I cd back to my project folder, but suddenly it looks like these:

    UserName@PC /c/xampp/htdocs/website

    before UserName@PC /c/xampp/htdocs/website (master)

    I tried git init and this showed up:

    Reinitialized existing Git repository in c:/xampp/htdocs/website/.git/

    but, nothing happen to my repo T__T

    it still looks like these: UserName@PC /c/xampp/htdocs/website

    Thank you very much, your guidance please t(^_^)

    EDIT: I did git stash save before power surgery & this files comes up:

    http://imgur.com/7sGctAg

  • mochadwi
    mochadwi over 9 years
    recently, I found that my .git/index & .git/HEAD file is corrupted after power surgery :'( Thank you for your advice sir, I though I would do a git clone but I didn't do much push either before >_< I stash every last my changed files and bam, I didn't remember the last time I did either git commit nor git push
  • VonC
    VonC over 9 years
    @MochaD yes, small andfrequents commits are best practice, and would ensure that you don't find yourself in this pickle in the future.
  • mochadwi
    mochadwi over 9 years
    yeah sir, I made much commit and try to minimize my doing. And try git stash to compare other branch much quicker, without have to commit first, or even twice commit with a tiny little changes ;'( I should try to search about this corruption, maybe I can find some solution! @VonC thank you very much sir!
  • mochadwi
    mochadwi over 9 years
    yet, I can't voted up your answer, I just had this account a month ago :D and still had 12 reputation, because you voted up mine question :D