We had a Git repo that was lost when the we forgot to back it up. One of us did a pull right before this happened and therefore has the latest code. Is it possible to rebuild the Git repo from a local copy of the sources? How?

link|improve this question

64% accept rate
feedback

1 Answer

up vote 4 down vote accepted

Your local copy is a Git repository on its own, containing the entire commit history (although only of the master branch). Creating an empty repository in the old location (git init --bare whatever.git), then running git push from the local copy should be sufficient.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.