git upload error! [rejected] master -> master (non-fast-forward) solution

The upload reports the following error:

Username for 'https://gitee.com': **@**.com
fatal: unable to get credential storage lock: File exists
To https://gitee.com/**/**.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/**/**.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.

Solution:

git pull username(gitee上的username) master --allow-unrelated-histories //把远程仓库和本地同步,消除差异
git add .
git commit -m '***'
git push username(gitee上的username) master

Synchronize the remote warehouse with the local one and eliminate the differences. The following window may appear:

solution:

1. When the above situation occurs, press the "Ese" button on the upper left corner of the keyboard;

2. Input " :wq ", pay attention to the colon in the English input state, and then press the " Enter " key. (What does " :wq " mean??? The command in the Linux operating system: compulsively write the file and exit.).

Guess you like

Origin blog.csdn.net/pinhmin/article/details/129615625