Git bare repo - /refs/head/master deleted - How to get last commit id?

I have a bare repository.

For unknown reasons the /refs/head/master file got deleted.

Because I don't know the id of the latest commit, I wonder how can I recover it so that I can recreate the master file (holding the id).

Answers


Use git reflog to find where your HEAD has been.

Note the hash of the appropriate commit and do git branch master <hash>


Need Your Help

Force my footer on the bottom of the screen even if content is not big enough (without being sticky)

html css footer sticky

I have a very simple question: When my content is not high enough to fill up the screen, the footer comes up and it looks a bit messy. You can see it here on a regular laptop monitor: http://www.dl...

OnScrollListener in gridview in a homescreen widget, is it possible?

android widget homescreen onscroll

I have a homescreen widget (android > 4.0) with a gridview and show some pictures within. And I want to make some additional views (imageview with icons or anything else) visible on scrolling this ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.