Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Git initialization

Shulou Source: shulou.com Published: 2022-06-03 07:34:56 11月23日 Update

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.

Tags: Address project preparation consistency reason file folder method time target first time error push Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Redmi Shulou Tech Info MySQL Shulou Technology