-2

After i entered git init I have directory D:myproject\.git

Is it good to add .git folder it in Github or should i add it in .gitignore?

glu
  • 79
  • 6
  • 1
    Does this answer your question? [What is the .git folder?](https://stackoverflow.com/questions/29217859/what-is-the-git-folder) – Greg Burghardt Jan 18 '21 at 16:45
  • 1
    The `.git` directory is what Git uses to hold the repository. The files that you work with aren't *in* the repository: what you work with is your *working tree* or *work-tree*. The *repository* is where Git keeps its own goodies. Git will refuse to store anything named `.git` in a Git repository because `.git` is where Git is keeping its own stuff. – torek Jan 18 '21 at 23:52

2 Answers2

0

You should not worry about .git folder. It contains git internals and all information in your repository like commits, branches and blobs. So .git is a repository itself and is handled automatically.

0

If you are in the root directory of your app and you do git init command what happens is that the command says initialize this directory and everything below it as a git repository. And it will set up a local repository for you on your machine.

Local repository on your machine allows git to track version changes in our files. Once we are happy with all those changes and our files then we push them to a remote repository on GitHub.

And you don't have to add your .git folder in .gitignore file.