记录第一次使用git命令的错误
git push到GitHub/码云的时候遇到的问题! ! [rejected] master -> master (non-fast-forward)
$ git push -u gitconfig master
To https://gitee.com/*****/SpringCloud****.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/*****/SpringCloud****.git'
hint: 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.
问题产生原因:本地仓库和远程仓库文件不一致
解决办法(一条命令即可):
git pull gitconfig master --allow-unrelated-histories
把远程仓库和本地同步,消除差异
gitconfig为别名自己给远程仓库取得别名