有一个文件夹 mydoc
里面有些涉及密码的东西,每次我push前,就将mydoc里面所有涉及密码的地方,改成xxxx
然后通过
git add .
git commit -m "new"
git push -u origin master
push完成后,我再将xxxx换成实际的密码,因为这个mydoc在我本机需要实际使用的。
感觉很麻烦,于是
cp -r mydoc /tmp
然后对tmp里面的文件,替换密码后,使用
git add .
git commit -m "new"
git push -u origin master
报错:
Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
请问,应当如何解决?
密码为什么会记在文档中?