SourceTree-使用总结

SourceTree-使用总结

配置总结

  1. 使用 sourceTree 的时候每次 pull 和 push 代码都得输入一次密码才能操作。解决办法:

    1. 添加SSH秘钥进行管理;。

    2. 如果添加上SSH也不行,可在SourceTree -> Preferences -> Git 中设置为 Use System Git,就是使用系统安装的Git

    3. 需要进行git config设置:

      1. 设置git config并保存你的GitLab用户名、邮箱及密码:

        git config --global user.name  "your user name"
        git config --global user.email "your email"
        
      2. 验证成功后需要输入GitLab的密码(这就是需要解决的问题)。我们先输入正确的密码,

        1. 可以临时缓存密码:git config --global credential.helper cache
        2. 或者一直保存密码(我用的下边这个):git config credential.helper store

      之后再pull就没有管我要密码了:

    4. 修改仓库路径地址:http://账号:密码@192.168.1.1:8000/test/Test.git

    其实也有一个可能是公司使用的是 GitLab,仓库的地址是 http 的,如果是 https 的应该就不会出现这种问题。

Bug总结

  1. warning: templates not found /usr/local/git/share/git-core/templates
    屏幕快照 2019-05-16 下午7.45.59.png

    重装系统,第一件事就是安装xcode和用SourceTree导入公司的项目
    谁料导入仓库的时候出现`warning: templates not found /usr/local/git/share/git-core/templates`
    仓库列表显示该仓库已被移动或者已经删除
    
    

    解决办法如下:

    1. 在SourceTree的 偏好设置- git 中,把"使用内置git" 更改为 "使用系统git"
      屏幕快照 2019-05-16 下午7.46.59.png
    到此为止就解决问题了
    也可以把该选项再切换回来,不影响使用。
    所以目测是一个templates相关的bug
    
    1. 如果还是不行,可能是Git所在电脑内存不够,重启Git所在电脑,再试;
    2. 使用git clone git*** --depth 1进行下载;
原文地址:https://www.cnblogs.com/cy521/p/10935843.html