git push 报错!!!!

时间:2023-03-09 14:40:34
git push 报错!!!!
[root@NB sh]# git push
To git@x0.xx.xxx.x1:yanjing_chenl/IT-DOC.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@xx.x.x.x1:yanjing_chenl/IT-DOC.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.

之前我直接在gitlab上做了改修保,而不是在本地提交的所以有问题

[root@NB sh]# git pull
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta )
Unpacking objects: % (/), done.
From xx.xx.xx.x1:yanjing_chenl/IT-DOC
3152d76..75ffcb1 master -> origin/master
Auto-merging sh/GUOER.SH
Merge made by recursive.
sh/GUOER.SH | +-
files changed, insertions(+), deletions(-)

再次提交问题解决:

[root@NB sh]# git push
Counting objects: , done.
Delta compression using up to threads.
Compressing objects: % (/), done.
Writing objects: % (/), bytes, done.
Total (delta ), reused (delta )
To git@xx.xx.xx.x1:yanjing_chenl/IT-DOC.git
75ffcb1..03424a3 master -> master