git+bitbucket使用备忘录
1. 上bitbucket官網注冊賬號。https://bitbucket.org/。注冊時,有一個谷歌驗證碼,必須用梯子才能刷新出來。然后注冊即可。
2. 本地windows安裝git。https://git-scm.com/。下載安裝包后默認安裝。
3. 找到一個目錄,右鍵,git bath here,彈出cmd窗口。
4. 命令窗輸入命令。
4.1 配置用戶名和郵箱,每次提交時都會在git log中顯示。
$ git config --global?user.name?“github’s Name”
$ git config --global user.email?"github@xx.com"
$ git config --list
$?git config --global core.quotepath false(git倉庫下中文編碼文件名編碼成中文,默認不是中文編碼)
$ git config --list
4.2 生成校驗碼。git需要公鑰和私鑰,私鑰存在本地,公鑰放在bitbucket服務器,每次提交git會檢測這兩把鑰匙,配對的話才允許你提交到bitbucket。這里我的路徑和默認密碼都是空,所以輸入命令后一路按回車即可。
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/ZCF/.ssh/id_rsa):
Created directory '/c/Users/ZCF/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/ZCF/.ssh/id_rsa.
Your public key has been saved in /c/Users/ZCF/.ssh/id_rsa.pub.
The key fingerprint is:
.....此處是省略...
$
4.3 打開默認路徑 /c/Users/ZCF/.ssh/,id_rsa是私鑰,不能給人看。id_rsa.pub是公鑰,需要記事本打開,復制到網頁。
?
4.4 點擊bitbucket個人首頁,創建倉庫。
4.5 打開倉庫,點擊clone,復制命令,本地打開文件夾,git bath here,彈出命令窗,輸入命令。
$?git clone git@bitbucket.org:xxxx/xxxxxxxxxxx.git
4.6 至此,倉庫創建完成,本地可以添加修改各種文件,也可以git push到遠程。
?
總結
以上是生活随笔為你收集整理的git+bitbucket使用备忘录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 舒亦梵:4.24非农周大数据即将来临,黄
- 下一篇: 如何使用pycharm连接Databri