Archive for the 'bash' Category

Waste your time due to accident git checkout? Prevent it now!

A common thing by using git in unix shell is accident executing git checkout -f command. For example, you want to reset some file by getting it from the head with git checkout -f filename, but instead of this you drop the changes on the whole branch by accidentally executing git checkout -f.

You can easily protect yourself by saving changes on the development branch into a tiny patch file before any git checkout command:

Read more »

Share