使用git时,错误集锦

1:输入git checkout -b comment origin/comment报错

fatal: 'origin/comment' is not a commit and a branch 'comment' cannot be created from it
原因:远程没有这个分支
如果远程有这个分支,还是不能创建,使用以下:

git remote        # 列出所有远程主机
git remote update origin --prune   # 更新远程主机origin 整理分支
git branch -r      # 列出远程分支
git branch -vv     # 查看本地分支和远程分支对应关系
git checkout -b comment origin/comment    # 新建本地分支comment与远程comment分支相关联

 2.git pull或push 每次都要Enter passphrase for key '/c/Users/Administrator/.ssh/id_rsa':

使用以下命令:

ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
ssh-keygen -p -P XXXXXX -N '' -f ~/.ssh/id_rsa

如果不生效的话: 

PS E:\StuXXXXXXX-fe> ssh-keygen -p
Enter file in which the key is (C:\Users\Administrator/.ssh/id_rsa): ~/.ssh/id_rsa
~/.ssh/id_rsa: No such file or directory
PS E:\StuXXXXXXX-fe> ssh-keygen -p
Enter file in which the key is (C:\Users\Administrator/.ssh/id_rsa): C:\Users\Administrator\.ssh\id_rsa
Enter old passphrase:
Key has comment 'qq邮箱地址'
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值