zoukankan      html  css  js  c++  java
  • git的入门使用


    在github新建一个仓库

    此命令初始化一个新本地仓库
    1.git init 目文件夹下面的文件都添加进来 2.git add .
    提交说明 3.git commit
    -m ''
    让本地仓库和远程仓库建立连接
    4.git remote add origin +  //远程仓库地址

    把本地仓库push到github上面
    5.git push origin master
    如果push上去出现以下情况
    $ git push origin master
    To https://github.com/1769073060/Mybatis.git
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'https://github.com/1769073060/Mybatis.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.

    解决办法

    $ git pull --rebase origin master  --先把远程拉下来
    $ git push origin master   --再提交本地就好了
     
     

    # 显示所有远程仓库

    $ git remote -v

  • 相关阅读:
    数组
    分支.顺序结构
    博客作业-查找
    DS博客作业-图
    DS 数据结构-树
    数据结构-栈,队列
    博客作业05-指针
    C语言博客作业04-数组
    C语言博客作业03——函数
    c语言博客作业02-循环结构
  • 原文地址:https://www.cnblogs.com/rzkwz/p/12423840.html
Copyright © 2011-2022 走看看