1. git: Your branch and 'origin/master' have diverged
Question:
# Your branch and 'origin/master' have diverged,
# and have 3 and 8 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
Resolve:
git fetch origin
git reset --hard origin/master
Your branch and 'origin / processos_criminais_151029' have diverged
git fetch origin
git reset --hard origin/processos_criminais_151029
2.每次提交部署环境 git status
今天clone代码,git status显示修改了大量文件,git diff提示filemode变化,如下:
git diff
old mode 100644
new mode 100755
windows,linux两种系统对文件权限的区分严格成都不一样,对于新增加的文件,git status 会显示如上情况。
原来是filemode的变化,文件chmod后其文件某些位是改变了的,如果严格的比较原文件和chmod后的文件,两者是有区别的,但是源代码通常只关心文本内容,因此chmod产生的变化应该忽略,所以设置一下:
切到源码的根目录下,
git config --add core.filemode false
这样你的所有的git库都会忽略filemode变更了~