1、操作
git add .
- git commit -m “我是老张”
- git push origin master
2、报错
To https://amc-msra.visualstudio.com/trading-algo/_git/real-trading
! [rejected] master -> dev-gaochao (fetch first)
error: failed to push some refs to ‘https://amc-msra.visualstudio.com/trading-algo/_git/real-trading’
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.
原因
在线上仓库生成、编辑了README.md文件,而本地文件中没有它,所以线上线下匹配不上
解决办法
将线上线下合并再push
git pull --rebase origin
git push origin master
END SUCCESS
Enumerating objects: 11, done.