Files do not appear in the Git repository

1

I created a new project here and then uploaded it to the server, but when I try to access the repository via URL it appears an Apache page with the name: Index of / site , that is, my project folder is empty, but when I give a git clone on a friend's computer using the same IP and the same project name as Git puts all the files and I can see them in localhost . Why is this happening on the server? Why can not I view the files on the server?

The repository was already on the server, but it still did not display the list of folders and files it contains.

Sequence of steps:

  • git clone ssh://@192.168.100.19/repositorios/git/api.git
  • cd api
  • rm -fr *
  • git add --all
  • git commit -m "removendo projeto antigo"
  • OBS : Before I gave the rm -fr there I would enter the URL and not list anything.

  • cd ..
  • cd apinova
  • git checkout master
  • git remote add origin ssh://@192.168.100.19/repositorios/git/api.git
  • git pull origin master There was no error here - > repository updated
  • git push -u origin master
  • I sent the files to the server, but when I access the URL nothing appears. The Apache page appears, which is: Index of /apinova , with nothing in the directory.

        
    asked by anonymous 13.07.2017 / 17:19

    1 answer

    0

    What happened is the following, we have a folder where the files are for example:

    api.git

    When we send a project to the server we send it to this folder and it automatically creates a project folder with all source code in / var / www.

    Anyway what was wrong?

    In the api.git folder, there is a file called config, inside this config file it was only the default configuration so I had to add some information by looking at the repositories already created, as an example of the default configuration:

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    

    Example of what I did for the system to work, I will exchange some information below I will not go here for settings of my server, for example:

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "origin"]
            url = ssh://git@ip-servidor/repositorios/git/api.git
            fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
            remote = origin
            merge = refs/heads/master
    

    This is where it works, now my project inside / var / www / api is being updated automatically.

        
    17.07.2017 / 17:12