M.O.R.R.I.S. M.O.R.R.I.S. - 1 month ago 17
Git Question

Upload .git - GitHub

i have continued to working with Github visual studio extension and accidentally I deleted

.git
repository from GitHub.
Now i study for working with Git bash and i not have a .git repository. There is a way for upload
.git
repository from GitHub?

Answer

If you accidentally deleted a .git folder in your local working copy, and want to restore it from remote repository (e.g. on GitHub), then the following should work (assuming that you are in the root directory where you want to put .git folder):

git init
git remote add origin <url>
git fetch
git reset origin/master

Here <url> is the URL of the remote repository (for instance, git@github.com:git/git.git or https://github.com/git/git.git).