Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Git initialization

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report