zoukankan      html  css  js  c++  java
  • Git 先创建项目后提交到仓库[Note about fast-forwards]

    1. 初始化: 
      git init
    2. 把项目添加到本地仓储:
      git add .
      git commit -am "备注"
    3. 添加远程地址
      git remote add origin https://gitee.com/xxx/xxx.git
    4. 本地分支和远程分支  建立连接
      git branch --set-upstream-to=origin/master master
    5. 因为远程仓库是刚创建的,本地仓库和远程仓库有不同的开始点【没有共同的commit】,需要拉取代码
      git pull origin master --allow-unrelated-histories
    6. 异常就是由【4/5】导致的
      $ git push
      To https://gitee.com/xxx/xxx.git
       ! [rejected]        master -> master (non-fast-forward)
      error: failed to push some refs to 'https://gitee.com/xxx/xxx.git'
      hint: Updates were rejected because the tip of your current branch is behind
      hint: its remote counterpart. Integrate the remote changes (e.g.
      hint: 'git pull ...') before pushing again.
      hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  • 相关阅读:
    Tensorflow和pytorch安装(windows安装)
    KNN和K-Means算法
    numpy 介绍与使用
    opencv简单实用(cv2)
    使用matplotlib画图
    python图片处理PIL
    webpack
    Vue路由(vue-router)
    Vue组件
    Vue过滤器、生命周期函数和vue-resource
  • 原文地址:https://www.cnblogs.com/Cailf/p/14447570.html
Copyright © 2011-2022 走看看