Cur*_*984 6 git github pycharm
我正在尝试完全删除并重新上传我的 GitHub 存储库。我正在使用 Pycharm 的 GitHub 集成,并且在我的一生中,我无法弄清楚如何让 Pycharm 忘记我曾经设置过 GitHub 存储库并从头开始。
我什至尝试将 .git 文件移动到另一个位置并清除 Pycharm 的缓存,但该死的东西仍然记得它有一个 Github 存储库设置,即使它实际上不再存在于 GitHub 上。
有人知道如何让 Pycharm 忘记吗?
输入git remote -v 将列出配置的遥控器。
origin git@github.com:user/repo.git (fetch)
origin git@github.com:user/repo.git (push)
gitlab git@gitlab.com:/user/repo.git (fetch)
gitlab git@gitlab.com:/user/repo.git (push)
Run Code Online (Sandbox Code Playgroud)
带有 github.com(https:// 或git@)的那个指向 GitHub 的远程。(这里origin)
要删除遥控器,您可以,
git remote remove origin
Run Code Online (Sandbox Code Playgroud)
或在旧版本的 git 中,
git remote rm origin
Run Code Online (Sandbox Code Playgroud)
要将新的 github 存储库添加为远程,您可以
git remote add <name> <repo url>
example. git remote add origin https://github.com/myusername/myproject.git
Run Code Online (Sandbox Code Playgroud)
在version control> 中log,向下滚动到初始(或任何特定)提交
然后点击 Reset Current Branch to Here...
然后选择硬
并按重置。(这是不可逆转的变化)
要将本地存储库中的更改推送到远程存储库(在重置为本地到所需提交后),请运行 push 以-f强制更新远程存储库。确保远程分支不受保护push -f。
git push -f <remote> <branch>
example. git push -f origin master
Run Code Online (Sandbox Code Playgroud)
.git内容并重新启动,您可以运行sudo rm -rf .git/
Run Code Online (Sandbox Code Playgroud)
在 repo 根目录下(这将删除 .git 目录,不可逆转的更改)然后运行 git init
| 归档时间: |
|
| 查看次数: |
7959 次 |
| 最近记录: |