1.git安装:(针对windows用户)
下载:https://git-scm.com/download/win
2.打开git bash配置用户信息(用户名和邮箱)
- git config --global user.name "tyler"
- git config --global user.email "[email protected]"
备注:可以安装source tree图形化工具(https://www.sourcetreeapp.com/)
安装的时候,你会发现有这样的一个界面,是让你验证邮箱的
破解之法:将accounts.json放到 C:\Users\Administrator\AppData\Local\Atlassian\SourceTree这个文件里面
accounts.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
}
]
3.简单git命令
初始化版本库 - git init
添加文件到版本库 - git add -git commit
查看仓库状态 -git status
4.创建远程仓库(gitHUb\gitLab)
5.sourceTree克隆仓库,拉取远程文件仓库到本地,提交修改的代码到本地仓库,推送至远程仓库,
6.标签管理