简体   繁体   中英

Is it good practice to add .git folder to Github?

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM