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.標籤管理