github clone时可以用https://..//.git

博客介绍了Git使用过程中的操作。因防火墙可能导致git clone超时,可换端口或协议解决。还展示了连接本地和对方远程仓库的操作,以及添加文件并提交到远程仓库的步骤,如通过Pull request提交。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,由于防火墙可能封住,所以git clone git@github.com/xxx.git时可能会超时,

换端口,或者换协议用git clone https://github.com/tianyahechy/spark.git
就顺利下载了

2,再测试,发现已经连上了远程本地仓库,

$ git remote -v
origin  https://github.com/tianyahechy/spark.git (fetch)
origin  https://github.com/tianyahechy/spark.git (push)

 

3,可是,我要给对方提交,所以还要连对方的远程仓库

$ git remote add upstream https://github.com/xxx/spark.git

4再次查看远程连接

$ git remote -v

origin  https://github.com/tianyahechy/spark.git (fetch)
origin  https://github.com/tianyahechy/spark.git (push)
upstream        https://github.com/XXX/spark.git (fetch)
upstream        https://github.com/xxx/spark.git (push)

说明已经连接上对方的远程仓库了

5,添加一个hello.txt.可以再github页面上有个upload files按钮,可以上传到本地

6,提交到远程

Pull request ->New pull requests->进入Comparing changes界面,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值