• git(二)


    一.GitHub(代码的云仓库)

    1.创建一个新的项目

     

     git remote add origin https://github.com/1352282824shy/COCAP.git
    git push origin master #上传master分支

    得到

    此时上传的是master分支

     

    2.下载git上的项目

    在需要下载项目的文件中调出Git的操作框

     git clone https://github.com/1352282824shy/COCAP.git #下载整个项目
    git pull origin dev #下载dev分支

    3.git版本控制

    版本控制之远程分支
    公司

    单位写的代码

    git add .
    git commit -m '2.25 单位'
    git push origin master #上传到github
    家里
    git pull origin master #下载代码

    在加写的代码

    git checkout dev
    get add .
    get commit -m '2.25 家里'
    get push origin dev #上传到dev分支

     

    版本控制之提交冲突
    家里
    git checkout dev
    touch a.py
    echo 'home' > a.py
    git add .
    git commit -m '家里' #不push
    单位
    git checkout dev
    touch a.py
    echo 'ali' > a.py
    git add .
    git commit -m '单位'
    git push origin dev

    家里

    git pull origin dev

    需要自己手动修改

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    HTML课堂笔记
    pycrul使用
    计算机网络概述
    重温冒泡排序
    初识MySQL
    宝塔Linux面板安装教程
    运维和shell
    nginx学习总结
    docker学习汇总
    linux 安装redis 完整步骤
  • 原文地址:https://www.cnblogs.com/shanghongyun/p/10476273.html
Copyright © 2020-2023  润新知