美文网首页
SourceTree中设置git 用户名与密码

SourceTree中设置git 用户名与密码

作者: FengxinLi | 来源:发表于2016-02-25 14:53 被阅读24414次

$ git config --global user.name "defnngj" //给自己起个用户名

$ git config --global user.email "defnngj@gmail.com" //填写自己的邮箱

克隆工程

git clone ssh://user:pssword@url

其中user是你的账号

password是你的密码

url是远程git库地址

Matching

‘matching’ 参数是 Git 1.x 的默认行为,其意是如果你执行 git push 但没有指定分支,它将 push 所有你本地的分支到远程仓库中对应匹配的分支。

Simple

而 Git 2.x 默认的是 simple,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

修改默认设置

从上述消息提示中的解释,我们可以修改全局配置,使之不会每次 push 的时候都进行提示。对于 matching 输入如下命令即可:

git config --global push.default matching

而对于 simple ,请输入:

git config --global push.default simple

相关文章

网友评论

      本文标题:SourceTree中设置git 用户名与密码

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