美文网首页
SourceTree使用问题记录

SourceTree使用问题记录

作者: duduodudu | 来源:发表于2020-05-29 12:26 被阅读0次

    问题

    • 克隆代码的时候警告内容warning: templates not found in /usr/local/git/share/git-core/templates,导致的失败。
      修复方法如下:
      在终端输入:sudo chmod -R 755 /usr/local/git/share/git-core/templates
      如果文件夹不存在:sudo mkdir -p /usr/local/git/share/git-core/templates
    • 错误:fatal: refusing to merge unrelated histories
      原因:两个分支是两个不同的版本,具有不同的提交历史
      解决:git pull origin master --allow-unrelated-histories
      可以允许不相关历史提,强制合并。

    • 查找是否安装了git
      git --version
      which git 查看git所在路径

    • 解决每次操作都让输入密码
      方案1:SourceTree -> 偏好设置-> Git -> 使用系统安装的Git ->打开->输入电脑登录密码->点击始终按钮
      方案2:git config --global credential.helper osxkeychain 参考

    • git pull时报错
      error: You have not concluded your merge (MERGE_HEAD exists).
      hint: Please, commit your changes before merging.
      fatal: Exiting because of unfinished merge.
      解决办法:保留本地的更改,中止合并 -> 重新合并 -> 重新拉取

    git merge --abort # 保留本地的更改,中止合并
    git reset --merge # 重新合并 
    git pull 
    

    相关文章

      网友评论

          本文标题:SourceTree使用问题记录

          本文链接:https://www.haomeiwen.com/subject/iiwgahtx.html