zoukankan      html  css  js  c++  java
  • git初识

    下载网上的开发员的项目

    git clone https://github.com/xxxxxx/test.git

    下载好,进入刚下载的好的test项目目录,可以修改对应的代码,然后

    git status 查询那些代码已经修改,或者新增

    git add .  把修改和新增的文件添加到缓存中

    git commit -m "xxxx" 增加这个版本的注释

    git push origin master 把版本推送到远程仓库的master分支中

    解决冲突

    git pull

    git diff

    git add .

    git commit -m "xxxx"

    git push origin master

    回到过去

    git log

    git reset --hard xxxx   #xxxx是版本的ID

    git reflog  #查看以前

    git reset --hard xxx

    注意:1多用客户端和工具,少用命令行(除非你是在linux服务器上直接操作)

    2.每次提交前,diff自己的代码,免提交错误的代码

    3.并行项目,使用分支开发

    4.遇到到问题,搞明白冲突,不要覆盖他人的代码

    5.产品发布后,记得打tag,方便将来拉分支修改

  • 相关阅读:
    代理
    博客园主题
    JS_1
    脚本语言
    Hadoop生态体系
    Hadoop序列化程序报错
    46. 全排列
    1038 Recover the Smallest Number (30分)
    1064 Complete Binary Search Tree (30分)
    1034 Head of a Gang (30分)
  • 原文地址:https://www.cnblogs.com/kevinlifeng/p/5007548.html
Copyright © 2011-2022 走看看