vscode上传代码到github
配置及上传
参考这篇帖子完成ssh key及后续的设置
执行 git branch -M main时,提示 error: refname refs/heads/master not found
参考这篇帖子进行改名操作,将master改为main,改名之后还不行,那注意可能漏掉了commit
git commit -m "first commit"
如果vscode中有不想上传到github上的文件,可以存放在.ignore文件夹下
git push --force
git地址变更 vs code 如何修改本地地址并查看
查看现有地址
git remote -v
复制原有地址并修改新仓库地址
git remote set-url origin http://xxx.com/group/project.git
查看现有地址git remote -v 检查是否切换成功
git add 之后撤销
使用命令
git reset .
修改upstream,指向不同的URL:
先删除现有的 upstream:
git remote remove upstream
然后再添加新的URL:
git remote add upstream https://********.git