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到远程。

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值