Today I was resetting a local Git repository to previous commits,, in order to trace back some changes which lead to Continious Integration tests failures. I did a few trail and error runs with:
git reset --hard SHA
Where SHA was taken from GitHub or git log. These commands were performed on my local branch which had some new changes commited locally, but not yet pushed to GitHub. Then, I found the working old commit I realized that I am stuck on it! There was a SHA for my latest commit and the command:
wasn’t showing my latest commit either, because I moved the HEAD of the branch behind it. Thansk for an advice, this command saved me:
git reflog BRANCHNAME
It had a short SHA of my latest commit and I was able to reset HEAD back with reset. I knew that Git had my change save, but I wasn’t sure how to get them. As usual Git is a great technology… with a terrible user interface! :-)
Cheat sheets are great ways to organize frequently used information and keep it handy. I used cheat sheets for learning and memorizing during my crams at school, and use them now for reference.
Cheat sheet for Web Development
Web development usually involves a large number of languages each with its own syntax, keywords, special sauce and magic tricks.
Here is a collection of web development cheat sheets, in no particular order, which I’ve amassed by browsing the Internet over many years of web development. They cover the following topics: