Solution to WeChat developer tool git error Push failed (for reference)

Record the git submission problem of your own WeChat applet.
The first is the error reported when pushing:
insert image description here
but don’t panic, check it out, it’s because there are conflicting submission records in the git version, and it says before your push in the last sentence, Then honestly push it and try it.
But I used the pull, and still reported an error:
insert image description here
After checking, it said that the current branch and the remote branch do not have a common basic commit record, that is, there are no common ancestors. In this case, manual merge is required two branches.
First, you need to connect to the remote warehouse:

git remote add origin 远程url

Then you need to use the following command:

git fetch //获取提交记录
git branch //查看远程分支名称
git checkout -b new_branch origin/remote_branch //创建新的本地分支
git add fileName //暂存修改的文件
git commit -m //提交修改
git push //完成推送

There are a few points to note here. Remember to change the origin/remote_branch of the local branch to your own name, not necessarily this; you can view the remote warehouse with git remote -v.
Then at this time, go to the WeChat developer tools to perform normal modification, temporary storage, and push, and that's it.

Guess you like

Origin blog.csdn.net/weixin_43148375/article/details/130707499