SmartGit, as you know (or may not know) is a Git client that enables you to commit, push, sync, pull and do many other things in your Git repository. SmartGit is connected to your repository at Gitlab.com, where you can manage your projects. However, sometimes it isn’t too easy to manage a Git repository.
I had just finished up some major changes to a website in a Git repository and was about ready to commit/push them out. But, I forgot one critical step in pushing out the changes: You must always pull before you do anything else. Unfortunately, I simply typed out the commit message and clicked the Commit & Push button. Instantly, down in the Log, I saw that one commit had been detached from the head and was just “origin”. That was the previous commit that I made. The one that I had attempted to push, the new page that I added, displayed “master < 1”. Also, there was an error in the Output window: Commit: Not all refs have been pushed. I now had a detached head.
This meant that all the changes that I had just made (which were indeed very large) had been trashed. And since I didn’t want to waste time trying to redo all of those changes, I looked up this problem. I was searching around StackOverflow until I found something: I only needed to click the Push button in order for everything to be back to normal. So I did. And at that instant, all the changes reappeared and everything was back to normal.
In the future, there were many more of these errors, even with Git automatically fetching every so often (in the background) but they were quickly resolved, and so saved the website from utter breakdown.
Muff Muff Mo