取消同步存储库 VSCODE
Unsync repository VSCODE
我已将 GIT 与 VSCODE 集成,这对我正在积极处理的存储库很有用。
但是,我曾经从某个我不能也不想更改其代码的人那里克隆,但无论我将它移动到本地的哪个位置,该程序总是渴望将其同步到初始远程存储库(不是我的)目录或我复制文件夹并重命名的次数。
我是新手,所以我不知道为什么会这样。
如何从本地(复制的)目录中完全删除 "GIT" 关联?
备份后,
- 尝试删除项目中的
.git
目录,然后
- 从项目目录中的命令行开始一个新的
git init
。
如果看不到.git
目录,是隐藏的,这是正常的。查看隐藏文件的说明因 OS 而异;或者您可以直接从命令行删除它。
当您从远程 git
克隆 git 存储库时,将设置对远程分支的引用并将它们命名为 origin
。 docs for git clone.
中对此进行了进一步描述
您可以在打开控制台并输入 git remote -v
时看到它
$ git remote -v
origin https://github.com/example/example.git (fetch)
origin https://github.com/example/example.git (push)
您可以通过更改 url、添加新遥控器或删除现有遥控器来编辑这些。
要删除名为 origin
的遥控器,您需要键入
$ git remote remove origin
However, I once cloned from someone whose code I cannot and do not want to change, but the program is always itching to sync it to the initial remote repository (not mine)
对于 VSCode 1.48 (July 2018),它不会再同步了
见issue 102393 and commit 413e660
您现在将看到:
You don't have permissions to push to '<owner>/<repo>' on GitHub.
Would you like to create a fork and push to it instead?
VSCode 会为您推荐create a fork。
我已将 GIT 与 VSCODE 集成,这对我正在积极处理的存储库很有用。
但是,我曾经从某个我不能也不想更改其代码的人那里克隆,但无论我将它移动到本地的哪个位置,该程序总是渴望将其同步到初始远程存储库(不是我的)目录或我复制文件夹并重命名的次数。
我是新手,所以我不知道为什么会这样。
如何从本地(复制的)目录中完全删除 "GIT" 关联?
备份后,
- 尝试删除项目中的
.git
目录,然后 - 从项目目录中的命令行开始一个新的
git init
。
如果看不到.git
目录,是隐藏的,这是正常的。查看隐藏文件的说明因 OS 而异;或者您可以直接从命令行删除它。
当您从远程 git
克隆 git 存储库时,将设置对远程分支的引用并将它们命名为 origin
。 docs for git clone.
您可以在打开控制台并输入 git remote -v
$ git remote -v
origin https://github.com/example/example.git (fetch)
origin https://github.com/example/example.git (push)
您可以通过更改 url、添加新遥控器或删除现有遥控器来编辑这些。
要删除名为 origin
的遥控器,您需要键入
$ git remote remove origin
However, I once cloned from someone whose code I cannot and do not want to change, but the program is always itching to sync it to the initial remote repository (not mine)
对于 VSCode 1.48 (July 2018),它不会再同步了
见issue 102393 and commit 413e660
您现在将看到:
You don't have permissions to push to '<owner>/<repo>' on GitHub.
Would you like to create a fork and push to it instead?
VSCode 会为您推荐create a fork。