经常在push到git服务器上时遇到如下错误提示:
git.exe push --progress "origin" master:master
To https://ter987@bitbucket.org/xmdabolo/dabolo.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://ter987@bitbucket.org/xmdabolo/dabolo.git'
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.
git did not exit cleanly (exit code 1) (7203 ms @ 2014-07-22 10:33:39)
提示远程服务器上有更新文件,需要先pull下来在push,于是点了pull,可是又提示如下错误:
git.exe pull -v --progress "origin" master
POST git-upload-pack (945 bytes)
POST git-upload-pack (500 bytes)
remote: Counting objects: 36, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 16 (delta 8), reused 0 (delta 0)
From https://bitbucket.org/xmdabolo/dabolo
* branch master -> FETCH_HEAD
062978c..244a590 master -> origin/master
error: Your local changes to the following files would be overwritten by merge:
includes/models/package_lottery_day.model.php
Please, commit your changes or stash them before you can merge.
Aborting
git did not exit cleanly (exit code 128) (27046 ms @ 2014-07-22 10:42:43)
提示本地文件将会被覆盖,请先提交。于是我commit 提示的文件,然后在push一次, 就可以成功push了。