1.常用命令
2.分支
处理冲突
当两个分支都对同一个文件进行过修改,当分支进行合并时,该文件会产生冲突,需要手动修改文件,确定文件到底如何修改,再重新进行提交。
此时git commit不需要文件名。
3.代码推送
错误
SSL
fatal: unable to access ‘https://hub.fastgit.org/rokned/Test.git/’: OpenSSL SSL_connect: Connection was reset in connection to hub.fastgit.org:443
最好不要使用http连接,使用ssh
第一次push
The authenticity of host ‘github.com (20.205.243.166)’ can’t be established.
ECDSA key fingerprint is SHA256:ASFGSDGWAWFSAF/ASDFFGGA/ASDFadDGAA.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
输入yes后回车
ssh key
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
可能没有设置ssh key
查询ssh key
cd ~/.ssh
cat id_rsa.pub
push提交密码
Enter passphrase for key ‘/c/Users/axax/.ssh/id_rsa’:
在生成SSH Key时,如果不小心设置了passphrase,使用SSH协议克隆远程仓库时,在每次git pull和git push时都会提示 Enter passphrase for key ‘/c/Users/gf115/.ssh/id_rsa’,每次都要手动输入密码才能继续操作,可以在命令行输入ssh-keygen -p进行重新设置,直接回车输入为空,就没有密码了。