Git init --bare - Not Working on working tree

前端 未结 2 862
暗喜
暗喜 2021-01-27 04:23

I am following the examples here http://wiki.dreamhost.com/Git

Basically I want to create a git repo i can push to on a server from my desktop... On host:



        
相关标签:
2条回答
  • 2021-01-27 04:40

    What you see seems correct. The .git files you see in that folder (and a lot of it in the objects directory) contains all your git repository.

    When you make a "bare" repository, this prevents anybody else to edit the files directly there (on your host machine), not having the project checked out with all your source file is one of the thing that would prevent such editing.

    0 讨论(0)
  • 2021-01-27 04:47

    git init --bare creates a "bare" repository - one that does not have a working directory associated with it. What you are seeing is what is expected. If you want a separate repository that has a checked out working directory associated with it, don't use the --bare option, but note that doing so has additional implications, because git push acts differently when the remote is not a bare repository, in order to protect you from losing any unstaged/uncommitted changes you may have in the remote.

    0 讨论(0)
提交回复
热议问题