zoukankan      html  css  js  c++  java
  • Git之多人协同开发

    一、获取远程库信息

    1
    2
    3
    $ git remote -v
    origin  https://github.com/xxxxx/node.git (fetch)
    origin  https://github.com/xxxxx/node.git (push) 

    二、克隆远程库

    1
    2
    3
    4
    5
    6
    7
    8
    $ git clone https://github.com/fuxinran/node.git
    Cloning into 'node'...
    remote: Enumerating objects: 301, done.
    remote: Counting objects: 100% (301/301), done.
    remote: Compressing objects: 100% (214/214), done.
    remote: Total 301 (delta 83), reused 287 (delta 72), pack-reused 0
    Receiving objects: 100% (301/301), 2.28 MiB | 318.00 KiB/s, done.
    Resolving deltas: 100% (83/83), done. 

    三、提交代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    $ cd node
    # 切换dev分支
    $ git checkout -b dev
    # 随便改点东西
    $ vim README.md 
    # 提交到公共区
    $ git add README.md
    # 提交到版本库
    $ git commit -m'[* update the README.md file ]'
    # 切换到master分支
    $ git checkout master
    # 合并代码
    $ git merge dev
    # 推送到远程服务器
    $ git push orgin master 

    四、解决冲突

    1
    2
    3
    4
    5
    6
    7
    8
    # 如果提交到远程库中出现代码冲突,将最新的代码拉下来
    $ git pull
    # 合并,解决冲突,提交远程仓库
    $ git checkout master
    $ git merge dev
    $ git add README.md
    $ git commit -m'[* update README.md file ]'
    $ git push orgin master 
  • 相关阅读:
    python匿名函数lambda用法
    python递归函数
    python中的全局变量与局部变量
    元组,字典,集合
    WKWebView 与 UIWebView
    JSON数组字典解析
    iOS使用Instruments的工具
    CocoaPods Mac App的安装和使用
    Mac环境下svn的使用(转)
    数据存储-- Core Data的使用(二)
  • 原文地址:https://www.cnblogs.com/pythonz/p/10933922.html
Copyright © 2011-2022 走看看