Git initialize remote repo

I followed this post to set up a remote git repository.

Instead of starting from scratch,

  • I did some development in my pc1 (the repo was created using git init)
  • Now I wanted to move the repo to the server (same subnet)

    ssh git@example.com
    mkdir my_project.git
    cd my_project.git
    git init --bare

  • Then locally

    cd my_project
    git remote add origin git@example.com :my_project.git
    git push -u origin master

Now, in the remote (server) repo, I see these folders

branch configuration description HEAD hooks info objects refs

I expected / want to see the same content as my local (pc1) git repo

bin doc src

+6
source share
2 answers

You have initialized the open repository on the remote side. This means that it stores a history, but does not have a working directory (translation - without actually checking the project). The structure you see is normal.

+8
source

git init --bare means that you are creating a bare repository, not a working repository. The bare repository is usually stored on the server and looks just like your .git directory of your working r-repository.

+4
source

Source: https://habr.com/ru/post/923441/


All Articles