Fix “Permissions are too open … private key will be ignored”

If you are getting this error then you probably reset the permissions on your hidden .ssh directory in your user folder, and your keys aren’t going to work anymore. It’s very important that these files not be writable by just anybody with a login to the box, so openssh will give you an error if you try to use them. Problem The full error message: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0744 for '/home/geek/.ssh/id_rsa' are too open. It is recommended that your private......

How to fix a corrupt git index

If your git index for some reason becomes invalid, no need to worry. Your index is corrupt when you see this error running usual git commands like git pull, git status, etc.: error: bad index file sha1 signature fatal: index file corrupt Though it sounds bad, your changes are still there. Fix it by first removing the index file, then resetting the branch: rm .git/index git reset You should be all good now. To be safe, make a backup of .git/index before you delete it. source link: http://makandracards.com/makandra/5899-how-to-fix-a-corrupt-git-index

git 递归删除指定目录下的某个同名文件

在使用git提交代码时,忘了添加.gitignore文件,把.DS_Store文件排除在track之外。因此会导致都被提交到了远程repo。怎么去把它删除掉呢? $ git rm --cached *\.DS_Store $ git commit -m "remove the .DS_Store files." $ git push