Git安装遇到的问题fatal: Could not read from remote repository.的解决办法
转自:https://blog.csdn.net/huahua78/article/details/52330792
查看远端地址 git remote –v
查看配置 git config --list
git status
git add . // 暂存所有的更改
git checkout . // 丢弃所有的更改
git status // 查看文件状态
git commit -m "本次要提交的概要信息" // 提交
设置远端仓库地址 git remote set-url origin 你的远端地址
git push origin master出现以下情况:
解决办法:删除当前key,然后重新生成key,
会在本地C:\Users\你的用户名.ssh生成文件夹,里面有id_rsa和id_rsa.pub两个文件
然后复制id_rsa.pub文件里面的内容,到https://github.com/settings/keys新建一个,
设置远程地址:(上面新建的)
git remote add origin_new 新的地址
git remote –v查看
git push origin_new master重新推送
下面是设置用户名
Git config –global user.name “用户名”
git config –global user.email 邮箱地址
设置代理:
git config –global https.proxy http://127.0.0.1:1080
取消设置代理:
git config –global –unset https.proxy
取消git init操作时出现 rm: cannot remove ‘.git’: Is a directory
是因为输入的命令是: rm -f .git
解决办法:rm -rf .git 即删除整个.git目录
failed to push some refs to ‘git@github.com:*.git’ hint: Updates were rejected ···
使用git push origin master的时候出现一下错误:
解决办法:
git push -f origin master或者git pull下
恢复不小心删除的 git stash 文件:
git fsck //找到dangling的对象
git show id //上面列出的每一条记录的最后一个字符串,按 enter 查看具体信息
git stash apply id
git 回滚提交
//reset将一个分支的末端指向另一个提交。这可以用来移除当前分支的一些提交, 让master分支向后回退了两个提交
git checkout master
git reset HEAD~2
//Revert撤销一个提交的同时会创建一个新的提交, 找出倒数第二个提交,然后创建一个新的提交来撤销这些更改,然后把这个提交加入项目中。
git revert HEAD~2
错误:Please enter a commit message to explain why this merge is necessary. 解决办法:
1. (可选)按键盘字母 i 进入insert模式
2. (可选)修改最上面那行黄色合并信息
3. 按键盘左上角”Esc” (退出insert模式)
4. 输入”:wq”,按回车键即可(提交)
gitignore notworking:
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
git Failed to connect to www.google.com port 80: Timed out 可能是因为设置了代理:
git config --global http.proxy //查看代理
git config --global --unset http.proxy //取消代理
HTTP Basic access denied on Git:
git config --global --unset credential.helper
git clone '···'
login username,password
rebase 和 merge 区别
git pull --rebase origin master
rebase 选项告诉 Git 把你的提交移到同步了中央仓库修改后的 master 分支的顶部。rebase 操作过程是把本地提交一次一个地迁移到更新了的中央仓库master分支之上。这意味着可能要解决在迁移某个提交时出现的合并冲突,而不是解决包含了所有提交的大型合并时所出现的冲突。这样的方式让你尽可能保持每个提交的聚焦和项目历史的整洁。反过来,简化了哪里引入Bug的分析,如果有必要,回滚修改也可以做到对项目影响最小。
git pull origin master
如果没有 rebase, pull 操作仍然可以完成,但每次 pull 操作要同步中央仓库中别人修改时,提交历史会以一个多余的『合并提交』结尾。
合并玩冲突之后,git rebase --continue,Git 会继续一个一个地合并后面的提交,如其它的提交有冲突就重复这个过程。
如果你碰到了冲突,但发现搞不定,不要惊慌。只要执行下面这条命令,就可以回到你执行git pull –rebase命令前的样子:git rebase --abort
Git安装遇到的问题fatal: Could not read from remote repository.的解决办法的更多相关文章
- fatal: Could not read from remote repository.的解决办法
1. git remote –v查看远端地址或者查看配置 git config –list 2. git status 3. git add . git status git commit -m “本 ...
- git clone ssh 时出现 fatal: Could not read from remote repository
一.问题及解决办法参考: 在 ubuntu 中,要把 GitHub 上的储存库克隆到计算机上时,执行如下命令: git clone git@github.com:USER-NAME/REPOSITOR ...
- gitlab 安装遇到 fatal:does not appear to be a git repository fatal: Could not read from remote repository. 问题
Cloning into 'door_lock_bsp'... git@192.168.1.5's password: fatal: 'door_lock/door_lock_bsp.git' do ...
- git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hos ...
- git提示错误关于错误:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.
关于 Git 使用中出现的错误 饥人谷_楠柒 关注 2016.11.02 15:33* 字数 746 阅读 3607评论 5喜欢 10赞赏 1 关于错误:ssh: Could not resolve ...
- 用ssh进行git clone出现 fatal: Could not read from remote repository.
问题:在通过MobaXterm进行ssh连接的服务器上用ssh进行git clone出现 fatal: Could not read from remote repository. 解决方法:prox ...
- git之fatal: Could not read from remote repository
问题背景:在git bash中使用hexo g -d命令进行文章发布 详细错误信息: fatal: Could not read from remote repository. Please make ...
- fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repository
天gitlab中遇到的问题: 当 git push origin branch_name时遇到报错如下: fatal:'origin' does not appear to be a git repo ...
- 【git基础】Permission denied (publickey). fatal: Could not read from remote repository
运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.22 ...
随机推荐
- [svc]centos7的服务治理-systemd
经常用到的高频命令小结 - 所有服务unit放在这里 ll /usr/lib/systemd/system - 默认启动级别 [root@n1 ~]# ll /etc/systemd/system/d ...
- MyEclipse中设置jsp页面为默认utf-8编码
转自:http://www.cnblogs.com/xdp-gacl/p/3496161.html 在MyEclispe中创建Jsp页面,Jsp页面的默认编码是“ISO-8859-1”,如下图所示: ...
- HTML5学习笔记(九):选择器详解
在前面的笔记中我们已经接触过几种常见的选择器,本笔记我们将深入了解CSS的选择器. 元素选择器 最常见的 CSS 选择器是元素选择器.换句话说,文档的元素就是最基本的选择器.在 W3C 标准中,元素选 ...
- scala future
https://docs.scala-lang.org/overviews/core/futures.html https://docs.scala-lang.org/overviews/index. ...
- [Windows Azure] How to use the Table Storage Service
How to use the Table Storage Service version 1.7 version 2.0 This guide will show you how to perform ...
- MyBean - 单实例插件改进和VCL插件的改进
BeanFactory中添加VclOwners:TComponent属性, 在getBean创建VCL插件的时候,Tcomponent.Create(VclOwners) 这样在清理DLL时就会释 ...
- IntelliJ IDEA中的properties文件乱码转成中文[unicode码转中文]
在IntelliJ IDEA中,一些.properties后缀的配置文件中的中文常常会是下面的样子,看不懂怎么办? 解决办法:File-->Settings-->File Encoding ...
- 【转】mysqldump的锁表的问题
今天凌晨,公司的一台MySQL生产库备份时间从2:30一直备份到8:30,正常情况下这个备份应该只会备份20分钟,3:00之前就会备份完毕,但是这次备份时间太长了,也影响了公司业务的使用.先写一下公司 ...
- LeetCode: Reverse Nodes in k-Group 解题报告
Reverse Nodes in k-Group Given a linked list, reverse the nodes of a linked list k at a time and ret ...
- Oracle数据库密码过期
按照如下步骤进行操作:1.查看用户的proifle是哪个,一般是default: SQL>SELECT USERNAME,PROFILE FROM DBA_USERS; 2.查看指定概要文件(如 ...