转自: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.的解决办法相关推荐

  1. fatal: Could not read from remote repository.的解决办法 . (git项目上传报错)

    查看远端地址 git remote –v  查看配置 git config --list git status git add . // 暂存所有的更改git checkout . // 丢弃所有的更 ...

  2. fatal: Could not read from remote repository.的解决办法

    原文地址:http://blog.csdn.net/huahua78/article/details/52330792 ---------------------------------------- ...

  3. Git push错误,Unauthorized fatal: Could not read from remote repository.未验证不能提交

    错误 git push -u origin master Unauthorized fatal: Could not read from remote repository. (Bitbucket - ...

  4. 记录git推送失败:fatal: Could not read from remote repository.

    GitHub远程仓库创建完成,本地推送是出现下面错误 原因是Github 服务器和我们本地的通讯要求使用 SSH Key 来验证 看报错原因可以知道是publickey权限问题 解决方法: 1.查看本 ...

  5. 解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas

    今天用idea提交代码到github上,push后报错 git@github.com: Permission denied (publickey). fatal: Could not read fro ...

  6. git@github.com:Permission denied(publickey).fatal: Could not read form remote repository错误

    文章目录 前言 问题分析 解决方法 配置客户端 配置服务端 验证 前言 在使用goland从github下载依赖时(git clone github.com/gin-gonic/gin)出现git@g ...

  7. git clone报错:Permission denied (publickey). fatal: Could not read from remote repository...

    原文:git clone报错:Permission denied (publickey). fatal: Could not read from remote repository- 今天clone一 ...

  8. fatal: ‘origin‘ does not appear to be a git repository fatal: Could not read from remote repository.

    fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. ...

  9. git解决 “fatal: Could not read from remote repository.“

    问题描述: 在使用Git将本地仓库推送到远程仓库的时候,发生了如下错误:"fatal: Could not read from remote repository." 问题原因: ...

  10. mac下git使用ssh时候的一个小问题:Permission denied (publickey). fatal: Could not read from remote repository.

    换了新电脑,配置了git的ssh keys之后就没怎么动过了,反正配置轻车熟路,就没有测试过. 今天更新一个项目的时候,怎么都更新不了,提示如下: > git clone git@github. ...

最新文章

  1. android:themes.xml
  2. 【树莓派编程】检测有没有物体移动 +人脸识别
  3. Skype for TV停止支持 三星确认今年6月移除该应用
  4. 分析函数在数据分析中的应用
  5. 登录服务器修改数据库吗,如何修改服务器登录数据库 sa
  6. php实现当前用户在线人数
  7. iQOO Neo 855竞速版来了:今年最后一款骁龙855 Plus手机
  8. ASP.NET(第七章数据插入与更新:DataList)-asp.net关注
  9. System.DllNotFoundException: 无法加载 DLL“GdltaxIA.dll”: 内存位置访问无效。 (异常来自 HRESULT:0x800703E6)。 WIN7系统
  10. 美团技术leader:写给工程师的十条精进原则
  11. web全栈工程师的自我修养(实际操作方面)
  12. sqlmap运行mysql命令_sqlmap命令总结
  13. linux截图翻译,图片实时识别翻译大师
  14. python---之struck.pack()和struct.unpack
  15. python怎么写excel数据透视自动报表_使用Python生成自动报表(E
  16. java的框架_java 三大框架——spring
  17. Java代码审计手册(1)
  18. java有符号和无符号右移
  19. 8个强大的UI设计工具-设计师利器
  20. RSA密钥BEGIN CERTIFICATE、BEGIN RSA PRIVATE KEY和BEGIN PRIVATE KEY的区别

热门文章

  1. JavaScript必须了解的知识点总结【转】
  2. Linux的shell中echo改变输出显示样式
  3. PowerShell 远程连接与其它技巧
  4. jQuery学习笔记:文档处理
  5. Asp.Net学习之-母板
  6. leetcode 12 Integer to Roman
  7. 转载-计算几何的题目
  8. AtCoder Regular Contest 061 DSnuke's Coloring
  9. hdu 1423(LCS+LIS)
  10. 【玩转Ubuntu】02. Ubuntu上搭建Android开发环境