Git initialization
After a new project is created on gitlab, README is added as a first submission. Execute under the local destination folder:
It happened when the project was commit locally after git init; git clone, and the push was prepared.
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.
Mistake. The reason is that the address to be pushed is not the same as the original address (I don't know why).
Solution:
Vim .git / config
[core]
Repositoryformatversion = 0
Filemode = true
Bare = false
Logallrefupdates = true
Ignorecase = true
Precomposeunicode = true
[remote "origin"]
Url = git@gitlab.xxx:xxx/xxx.git
Fetch = + refs/heads/*:refs/remotes/origin/*
Pushurl = git@gitlab.xxx:xxx/xxx.git
[branch "master"]
Remote = origin
Merge = refs/heads/master
Then execute git pull-allow-unrelated-histories
You can push.