【Git】如何将本地非git目录与远程创建的git目录建立关联
Git 如何 远程 创建 目录 本地 建立 关联
2023-09-14 08:57:35 时间
一、操作步骤
1、git init //git初始化 2、git add --all . 3、git commit - m "first commit" 4、git remote add origin gitUrl //将git进行远程连线 5、git push -u origin master //推代码更新fork仓库
二、可能出现的错误及解决办法
1、fatal: remote origin already exists.//连线已经存在 解决方法:执行 git remote rm origin 将已存在的连接删除 2、error:failed to push som refs to....... 解决方法:执行git pull origin master 先将远程服务器上的文件拉下来 3、fatal: refusing to merge unrelated histories”//本地的和GitHub上没有共同祖先 解决方法:执行 git pull origin master --allow-unrelated-histories
相关文章
- 如何存储 Git 大文件?
- git:Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).
- git 使用
- [Git] Use and Compare the Different git Reset Options: --hard, --soft, and --mixed
- [Git] Automatically running tests before commits with ghooks
- Git远程04:git fetch & git push & git pull
- Git远程01:git remote相关操作
- [Practical Git] Clean up commits with git rebase
- SourceTree 如何下载git 管理的代码-如何创建分支,删除分支,提交代码,回退代码
- 史上最强教你如何使用vscode 和 gitee 和 git 三大法器完美搭配,一步步详细图标过程,还不会你砍我
- git init github
- Git知识总览(六) Git分支中的远程操作实践
- Git知识总览(二) git常用命令概览
- 如何查看git version多少(两种方法)
- 【分布式版本控制系统】Git
- Git实战之git客户端上传文件到github
- C/C++开发,关闭vscode中的插件git工具
- 【Git】利用 GIT 做版本控制