Tag Archives: Git

Git: Delete Last Commit

Many times like you, even professional programmers do mistakes. A lot of times it happens that you commit something junk in hurry and then you start looking out for reverting it back. Like you even I have done such mistakes many times and finally I thought to write down a few useful git commands which will help me to revert back to stable copy of project.

Using ‘git reset’

So, if you have committed something junk, not useful but you have not pushed it to remote repository then you can go with


git reset --soft HEAD~1

git reset‘ command will reset your current commit. The ‘HEAD~1‘ mentioned here is nothing but shorthand for your last commit and the ‘–soft’ option specified in the command will keep all the changes in working copy.
Continue reading Git: Delete Last Commit

Git – Autocorrect spelling

Git is but of course one of the most powerful DVCS client and it is used by millions of developers worldwide. Git do provides a lots of features to work with different versions of your software. Some of those features are well known but others are not that much popular. One of such non popular feature is Git Autocorrect.

Git do have capability to check whether the commands you are firing at git console are correct or not. If the commands are not correct then Git can suggest you corrections. In fact git can auto correct your wrong command.

Let’s take an example. You are in hurry and you misspelled “Git Push” as

git pusj

and pressed enter. Git will generate following error message…

git: ‘pusj’ is not a git command. See ‘git –help’.
Did you mean this? push

and will wait for your input.

Continue reading Git – Autocorrect spelling