协作开发——使用git在多台机器上实现协作开发

1 协作开发

我们将要使用git版本控制系统在多台机器上实现协作开发;
使用私有repo来进行项目的线上同步;

2 新建项目repo

这里我们使用PyCharm直接进行版本控制的操作,首先需要在PyCharm上添加我们的GitHub账户,操作路径:File → Settings → Version Control → GitHub;

3 Clone项目repo

这里使用PyCharm提供的Git支持组件直接从我们的账号中clone已有的项目,
操作路径:VCS → Get from Version Control… → GitHub (user_name);
其示意图如下:
在这里插入图片描述

3.2 问题备忘

从GitHub上clone项目时,出现“git: OpenSSL SSL_read: Connection was reset, errno 10054”

git -c credential.helper= -c core.quotepath=false -c log.showSignature=false clone --progress --recurse-submodules https://github.com/…/…git – Python_Git_test
Cloning into ‘Python_Git_test’…
fatal: unable to access ‘https://github.com/…/Python_Git_test.git/’: Operation timed out after 300005 milliseconds with 0 out of 0 bytes received

这个错误是由于git在连接VCS服务器时出现了超时的现象,所以为了解决这个问题,我们可以调整IDE与GitHub连接的等待时间,
操作路径:File → Settings → Version Control → GitHub;
将 Connection timeout加倍,直到可以成功clone为止;

[Log]: 2020.5.5 在Win10上将 Connection timeout设置为21,则可以clone成功。

4 同步代码

4.2 问题备忘

已经将文件加入到.gitignore,但是commit时仍然出现文件

这是因为修改后的文件,已经被加入到缓存去中,需要删掉这些文件的缓存:

git rm -r --cached $absolute_subfolder_path

这里我们也看看cached 字段的含义:

–cached
Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone. (仅删除文件路径的索引,原始工作文件则会被保留)

2 查看repo

查看commit的时间轴

点击repo文件列表右侧的时间轴按钮
在这里插入图片描述
就可以看到最近commits的时间轴信息了;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值