Git stash

Git is arguably the most versatile version control system around and one cannot resist falling in love with this awesome piece of code every time you use it.

One of the lesser known features in Git, especially for individual developers/teams who have recently migrated from other tools is the “stash” command.

You might often find yourself in situation when you aren’t yet ready to commit your code, you would like to view the last commit without trashing the existing code. You could also be in situation when you want keep your local changes without committing and then swap to do something else.

This is where the stash comes into the picture. Stash creates a backup of your current staged and unstaged changes, and returns your branch to the last commit. To stash your changes, you use the stash command.

git stash

When you are ready to go back to your stashed changes, you can use the ‘git stash apply‘ command. This would take your latest stashed changes and apply it to the branch.

git stash apply.

Finally you could delete your stashed changes by using the git stash drop command.

git stash drop.

This would remove your last set of stashed changes.

Remove Debug / Binaries from GitHub

I am pretty new to GitHub platform and one of the first mistakes I did earlier on was to commit (unknowingly) the Debug Folders and all its binaries. It was later on i found ways to add ‘gitignore’ files, but no matter what i did, the debug files continued to be reflected in the change list.

The solution was though easy one, I had to run the following command to clear the Git Cache, and then stage-commit again. That cleans up all the mess.

git rm -r . --cached