zoukankan      html  css  js  c++  java
  • git远程仓库的使用

    简易的命令行入门教程:

    注意:git上传文件push时,不能上传超个100M的单个大文件(码云和github有限制)

    Git 全局设置:

    git config --global user.name "xxx"
    git config --global user.email "xxxx"

    创建 git 仓库:

    mkdir jz0001
    cd jz0001
    git init
    touch README.md
    git add README.md
    git commit -m "first commit"
    git remote add origin https://gitee.com/xxx/xxx.git
    git push -u origin master

    已有仓库?

    cd existing_git_repo
    git remote add origin https://gitee.com/xxx/xxx.git
    git push -u origin master

    二、如果报错

      1、报错如下:

    error: failed to push some refs to 'https://gitee.com/xxx/xxx.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

      

      解决办法:亲测有效,借鉴博客:https://blog.csdn.net/zhao_xin_peng/article/details/79378895

    git pull --rebase origin master


    此时再执行语句 git push -u origin master即可完成代码上传到oschina

    。。。

  • 相关阅读:
    类加载
    LinkedList插入排序实现
    99乘法表
    关于IO流的抽象类
    分解质因数
    Struts2小demo遇到的几个问题
    Tomcat设置欢迎页问题
    数据库迁移
    EF – 1.模式
    正则表达式
  • 原文地址:https://www.cnblogs.com/spll/p/14351033.html
Copyright © 2011-2022 走看看