Git代码上传简单配置

1. Github端

(1)在github创建新的Repository.
(2)复制该库的远程仓库的地址
https://github.com/xxx/xx.git
Notes:保持本地分支和远程仓库分支的一致。

2.本地

(1)在本地文件夹执行git init,初始化Git仓库。
(2)git remote add origin https://github.com/xxx/xx.git 关联远程仓库。
可能会出现fafal: remote origin already exists.
If origin exists, you can do one of the following:

  • remove origin from the remote list via remove command, like so: git remote remove origin
  • update origin pointing URL with set-url, like so:git remote set-url origin [new-url]
  • rename the existing origin handler to something else via rename command: git remote rename origin [new-name]
    How to fix ‘fatal: refusing to merge unrelated histories’ Git error
  • Here the git command will look something like this: git pull origin master --allow-unrelated-histories.
    (3)git pull origin main 同步远程仓库和本地仓库。
    (2)git add . 添加所有文件至Git仓库
    (3)git commit -m "" 提交至Git仓库。
    (4)git push origin main 将本地仓库修改(或者添加)的内容提交到远程仓库。
  1. 每天自动推送脚本
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值