git常见问题及解决方法
简介
由于在git使用过程中会出现各种各样的问题,因此本文将常见的问题记录下来并提供相应的解决方案,方便后续查找。
git clone出现 SSL certificate problem: unable to get local issuer certificate
这个问题是由于没有配置信任的服务器HTTPS验证,只需要关闭ssl认证即可
git config --global http.sslVerify false
git pull问题: There is no tracking information for the current branch.
$git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> source
由于当前的分支没有跟踪到git上的对应分支。
解决方法
1.直接拉取对应分支代码:
git pull origin <branch>
2.将本地分支跟踪到git上的对应分支:
git branch --set-upstream-to=origin/<branch> source
git pull问题:Your configuration specifies to merge with the ref 'refs/heads/v.autoCheckProduct.20190325' from the remote, but no such ref was fetched.
可能是由于远程分支名称发生了变动,可以先切换为其他分支,再切回来即可
git checkout master
git pull
git checkout develop
git clone/push总是需要输入用户名和密码
可以先输入以下命令永久保存密码,在下次输入用户名密码后将记录密码
git config --global credential.helper store

浙公网安备 33010602011771号