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.