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 error set

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

Git push failed failed to push some refs to git

Https://www.zybuluo.com/hwk603/note/172823

Several solutions to errors in native code push to git:

Https://www.douban.com/note/332510501/

The github version library you just created has an error in push code:

$git push-u origin master

To git@github.com:*/Demo.git

! [rejected] master-> master (non-fast-forward)

Error: failed to push some refs to 'git@github.com:*/Demo.git'

Hint: Updates were rejected because the tip of your current branch is behind

Hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')

Hint: before pushing again.

Hint: See the 'Note about fast-forwards' in' git push-- help' for details.

I searched the Internet because of the conflict between the remote repository and my local repository, and after I created the version library, I clicked the button to create the README.md file on the github version library page to create the documentation, but there was no pull to the local. This gives rise to the problem of version conflicts.

There are several solutions:

1. Use the method of forcing push:

$git push-u origin master-f

This will result in the loss of remote modifications, which is generally undesirable, especially when multi-person collaborative development.

Modify the remote repository to pull before 2.push

$git pull origin master

$git push-u origin master

3. If you don't want to merge remote and local modifications, you can create a new branch first:

$git branch [name]

And then push

$git push-u origin [name]

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

Network Security

Wechat

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

12
Report