HTTPS協議推送
使用HTTPS協議,有壹種簡單粗暴的方式是在遠程地址中帶上密碼。
> git remote set-url origin :<用戶名>/版本庫名
或者
> git remote -v
> git remote set-url origin git@github.com:<用戶名>/版本庫名
執行推送。
> git push -u origin master
發現提示權限不夠。
The authenticity of host 'bitbucket.org (104.192.143.1)' can't be established.
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bitbucket.org,104.192.143.1' (RSA) to the list of kn
own hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
需要在本地創建該帳號的RSA Key。可以參考以下兩篇文章:
Windows下配置SSH連接Github
Git如何在本地生成多個SSH key
然後再執行推送。
> git push -u origin master
就可以推送成功了。