Git如何合并并删除本地以及远程误创建并提交的master分支到Git默认的main分支?
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
事件回顾
- 由于本人在本地创建了一个项目,将其推送到Git远程仓库后,发现本地的是master远程的是main,这就造成了默认的主分支不一致,故而有了这个需求
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
以下是一些常用的 Git 命令:
git init
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
E:\Google\vuepress-theme-hope>git push github master
Connection reset by 20.205.243.166 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
Administrator@DESKTOP-DFD9CE5 MINGW64 /d/alibaba/studyLog
$ git status
fatal: detected dubious ownership in repository at 'D:/alibaba/studyLog'
'D:/alibaba/studyLog' is owned by:
'S-1-5-21-1768174577-13754125-2598047118-1001'
but the current user is:
'S-1-5-21-2607242180-1233388006-380827990-500'
To add an exception for this directory, call:
git config --global --add safe.directory D:/alibaba/studyLog
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
如果我们在本地完成了一个 项目 那么我们想将其远程传入Github 或者 Gitee 那么应该如何操作呢?
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
Logon failed, use ctrl+c to cancel basic credential prompt. remote: Support for password authentication was removed on August 13, 2021. remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication. fatal: Authentication failed for 'https://github.com/javaobjects/studyLog.git/'