pushing to a git repository does not work

前端 未结 4 757
予麋鹿
予麋鹿 2020-12-09 06:06

I am just starting out with GIT (i\'m coming from cvs) and would like to set up something akin to cvs/svn with Git. I performed the following steps:

cd o:/r         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 07:09

    This happened to us a few weeks ago. It means that you have a working directory checked out in your origin repository and you cannot push to overwrite.

    at the origin you need to bare the repository. I don't know of a way to do it with one command. What I did (at the origin repository)

    > mv repository repository.old
    > git clone --bare repository.old repository
    

    I see that the origin in your case is the o:/repository. The origin, should not be a checked out working copy, so you can init a bare repository or copy as per above. To get the scenario you described to pass:

    cd o:/repository
    git init  --bare
    
    cd 
    git clone o:/repository
    
    git push origin master
    

    this should work just fine for you:

    good reading: http://www.gitready.com/advanced/2009/02/01/push-to-only-bare-repositories.html

提交回复
热议问题