Files do not appear in the Git repository

Asked

Viewed 3,769 times

2

I created a new project here and then uploaded it to the server, but when I try to access the repository via URL an Apache page with the name: Index of / site, ie 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 Download all the files and I can view them on localhost. Why is this happening on the server? Why can’t I see the files on the server?

The repository was already on the server, but it still didn’t show the list of folders and files it contains there.

In working on server that works on the local network, I delete the old project that was on the server and then sent my project to the same repository that was already created.

Sequence of steps:

  1. git clone ssh://@192.168.100.19/repositorios/git/api.git
  2. cd api
  3. rm -fr *
  4. git add --all
  5. git commit -m "removendo projeto antigo"

OBS: before I give the rm -fr there I entered the URL and did not list anything.

  1. cd ..
  2. cd apinova
  3. git checkout master
  4. git remote add origin ssh://@192.168.100.19/repositorios/git/api.git
  5. git pull origin master No error here -> updated repository
  6. 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 the: Index of /apinova, with nothing in the directory.

  • 2

    I don’t know. Can you [Edit] the question and add more details about the structure of your server? What commands do you want to use? How is the server organized? How is it configured? Etc.

  • I tried to explain better.

  • The repository is in the Apache root directory?

  • @Lucas takes a test and then comments on the result. Delete any copy of the project, recreate it with the git glone as you do. Make a simple change. Apply the git status and take a print of the answer in the terminal and add the question.

1 answer

1


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

git api.

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

Finally what was wrong ?

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

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

Example of what I did to make the system work, I will exchange some information below do not go here configurations of my server, 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

Fis that there and it worked, now my project within /var/www/api.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.