In many integrated development environments, it is impossible in the usual way to make the same folder a local repository (for example, a git repository) and a project folder (now it doesn’t matter which projects you are talking about - this can be a website or an application in any programming language ). But everything is more convenient when both the repository and the project are in the same root folder, especially since if you attach a project folder to the repository folder, the project tree, which is in many IDEs, may not give access outside the project root directory. In addition, the readme file is usually placed in the root of the repository, rather than the project (if it doesn’t match), and I would also like to edit it in the environment.
|
1 answer
create file / directories inside git-storage (otherwise - git-repository), i.e. in the directory with the name (by default) .git , of course you can:
$ touch .git/file but git (by default) won't allow you to control versions of this file:
$ git add .git/file error: Invalid path '.git/file' error: unable to add .git/file to index fatal: adding files failed therefore it is better to keep the working directory files ( working directory ) separately: by default, in the same directory as the directory with the repository.
- Thank you for your reply! I did not mean the folder.
.git, I had in view of the rotator folder in relation to the directory..git. I will ask this: if the.gitfolder is among the project files, that is, inside the project folder, will it be normal? (ProjectFolder/.git) - Gleb - oneYes, this is normal and that is exactly what the git program does by default: the file / directories whose history you are tracking are usually located in the same directory as the repository itself (that is, the
.gitsubdirectory) - aleksandr barakin - Clear! Then I will do that now! Thanks again for the reply. - Gleb
- Alexander, aren't you going to stand for election? I remember how you persistently and methodically raked up queues of checks and lists of unanswered. We now just need such a person. - Nick Volynkin ♦
- @NickVolynkin, ru.meta.stackoverflow.com/questions/6114/… - aleksandr barakin
|
/, even directly inC:\. (Well, in / proc / will not work). - Nick Volynkin ♦NetBeansin the usual way, I mean creating a new project through the wizard to create a new project. If you select “Initialize a Git repository” in theNetBeansmenu and then start creating a project,NetBeanswill definitely create a project folder inside the one you specify. - Bokov Gleb