最近技术群里有人问关于团队中git使用的相关问题,恰巧我的笔记本还了新固态,东西都没有了,反正是得配置,索性所以写一写相关的博客。
1介绍
SourceTree可以帮助你快速使用git的界面工具软件(拥有可视化界面的项目版本控制软件)。用过的人都说好。首先你需要注意的是在使用它时,你的电脑里需要安装git,需要安装git,需要安装git。
2跳过Atlassian账户 免登陆
我相信你是在看到这个安装界面时来找的教程
解决方法:
在C:\Users\Administrator\AppData\Local\Atlassian\SourceTree文件里放入新建(或修改)accounts.json并重新安装
下面是详细介绍,你在找这个文件时,当到了Administrator时,发现并没有AppData文件夹
不要急,把路径复制一下,如下图
如果没有accounts.json文件则新建一个,有的话就修改。然后把下面的json复制进去,保存。
[
{
"$id": "1",
"$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",
"Authenticate": true,
"HostInstance": {
"$id": "2",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountInstance, SourceTree.Host.AtlassianAccount",
"Host": {
"$id": "3",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountHost, SourceTree.Host.AtlassianAccount",
"Id": "atlassian account"
},
"BaseUrl": "https://id.atlassian.com/"
},
"Credentials": {
"$id": "4",
"$type": "SourceTree.Model.BasicAuthCredentials, SourceTree.Api.Account",
"Username": "",
"Email": null
},
"IsDefault": false
}
]
然后关了界面,从新安装
2使用方法:
相关知识:https://www.cnblogs.com/zhaoyanjun/p/5882784.html
协作者的通知会发在邮箱里,实时查收哦。
前期配置:https://blog.csdn.net/tengdazhang770960436/article/details/54171911
理解:https://blog.csdn.net/qq_35246620/article/details/65636022
3错误
1.git -c filter.lfs.smudge= -c filter.lfs.required=false -c diff.mnemonicprefix=false -c core.quotepath=false clone --branch master [email protected]:944/tdroid.git E:\Android\Work\TestGit
fatal: destination path 'E:\Android\Work\TestGit' already exists and is not an empty directory.
完成时带有错误,见上文。
解决方法:
1先检查你的是不是选的ssh,如果是请看步骤2。
2检查你放克隆的文件的文件夹是不是空的,如果不是,请换一个文件夹(不要因为是刚新建的文件夹就不检查,请检查一下)。
2.ERROR: You must verify your email address. See https://github.com/settings/e
解决方法:你的邮箱没有验证,你的邮箱里应该有邮件的,你去点一下就行了。
3fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法:没有权限,你不是项目的协作者,在2使用方法中有介绍
4
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:951124484/testandroid.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
5.
git -c diff.mnemonicprefix=false -c core.quotepath=false pull origin master
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.