github创建项目以及分支问题

第一步,创建项目

 第二步 

 第三步,赋值项目git链接

 

 

 第四步,在本地项目上操作

1.git init 初始化本地仓库

2.git remote add main https://github.com/SmallCaiBa/mprpc.git 设置远程仓库地址

3.git remote -v 查看本地配置是否正确

4. 提交全部代码

git add .

git commit -m "所有mprpc代码"

出现以下提示

git config --global user.email "18281870344@163.com"

git config --global user.name "SmallCaiBa"

再git commit -m "所有mprpc代码"

git push main(main为你的分支)

如果出现

fatal: 无法访问 'https://github.com/SmallCaiBa/mprpc.git/':Failed to connect to github.com port 443 after 21051 ms: 拒绝连接

查看设置 git remote -v

将之前的设置的https改为git

 git remote set-url origin git://github.com/SmallCaiBa/mprpc.git

再重新git push main

 

扩展,如果你是需要分支的话。

1.查看分支

 git branch

2.创建新的远程分支

git branch test

3.切换到test分支

git checkout test

添加一个新的任何test.txt

 git add test.txt

git commit -m "提交到新的分支上"

git push --set-upstream main test(新的分支)

success!!! 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值