首先在Bitbucket上創建項目、倉庫。
參考:Bitbucket在PyCharm上提供Git服務(SSH Key方式)
clone項目倉庫
VS Code中SSH方式clone項目倉庫。如果沒有配置SSH,可能的結果:
> git clone git@bitbucket.org:caryqd/js_liaoxf.git d:\js_liaoxf --progress
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
使用https方式,VS Code里需要錄入口令。
點擊【Clone in VS Code】,自動打開VS code:
選擇Clone a new copy
;
選擇項目上級路徑;
錄入口令。后續push可以發現口令已記住。
克隆完成,選擇【在新窗口中打開】
VS Code新增文件,推送驗證
增加新文件
暫存所有文件
提交
推送
未提示再次錄入口令,可見口令已記住。
上Bitbucket查看,新增文件已推送完成。