Since I am a regular user, I only use Github at the git clone * level. Found, for example, a small utility, read the description; I like it - I download the source code, if necessary, I compile it, use it. It's all clear.

But I faced such a problem. When you download the utility and go to its directory, there is nothing there except the README (at first glance). If we enter the ls -all will find the hidden .git folder and the .gitignore file. In the folder. .git will be the following directories and files:

branches config description HEAD hooks index info logs objects packed-refs refs

I do not understand what to do with all this and what it generally is. Explain, please, how to use it? How to build a program from this all to make it work?

  • 2
    You will have to rewrite the question. Give an example. Specify the repository address. Describe what you wanted to receive, what you have already received, what did not succeed. - oshliaer
  • @Stepa In the .git directory, the git’s “brains” are all manipulations and their history with this VCS stored there. The .gitignore file allows you to set rules according to which individual project folders / files will be ignored. These "artifacts" are service. If you are not going to continue the development of this project, you can safely remove them. - romeo

2 answers 2

The contents of the .git folder is actually a repository. Do not look for your files in it, they cannot be there. It has its own data storage structure, similar to the unix file system.

.gitignore is a list of files (given in the form of regular expressions) that git will ignore.

The program from this does not collect in any way. Read the readme, as mentioned above. You can also look at the wiki-pages of the corresponding repository on github.

There is a small chance that everything was deleted by one of the last comments, as suggested by @KoVadim. In this case, run git log to see what happened there before. You can also take the SHA-code of any of the previous commits (this is a long line like abcd1234) and make git diff abcd1234 .

  • 2
    "Do not look for your files in it, they cannot be there" - this is not so. All files are stored in the .git folder. But you should not look for them there, it’s true. - ixSci
  • 2
    you can try git log and see. Maybe there the last commit all deleted. Then it will be possible to "wind off the story" and get sorts. - KoVadim
  • one
    Well, they are stored in the form of blobs, which can not be read manually. - Nick Volynkin
  • one
    depending on what is meant by the word "by hand". git show <sha1> - is it manual or not? - KoVadim
  • one
    git show <sha1> - it is still found with the naked eye. Moreover, the necessary sha1 will have to be found somewhere. - Nick Volynkin

Apparently, you have cloned a repository in which there is nothing other than README in the default branch. Read the README, maybe there will be some hints about where to get the source.