zoukankan      html  css  js  c++  java
  • git学习

    echo "# test" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/iamyadi/test.git
    git push -u origin master
    

    …or push an existing repository from the command line

     
    git remote add origin https://github.com/iamyadi/test.git
    git push -u origin master

    1、错误解决:
    今天按照上面步骤,然后关联本地库的时候pull失败,错误为:fatal: refusing to merge unrelated histories
    解决方案为:git pull 或者 git pull origin master, 修改为以下代码:
    git pull origin master --allow-unrelated-histories

    2、如果不小心commit了,但是还没有push,则可以输入git reset HEAD~1
    意思是: 将版本库回退1个版本,将本地版本库的头指针全部重置到指定版本,且会重置暂存区,即这次提交之后的所有变更都移动到未暂存阶段
  • 相关阅读:
    Spring MVC
    Hibernate的状态
    设计模式
    Git在Eclipse中的使用
    深入理解Node.js基于事件驱动的回调
    nodejs核心技术
    webpack使用
    vue各种实例集合
    vue之component
    axios详解
  • 原文地址:https://www.cnblogs.com/yadiblogs/p/8711372.html
Copyright © 2011-2022 走看看