zoukankan      html  css  js  c++  java
  • git 使用系列(二)---- 分支和合并

    Branching and Merging

    The Git feature that really makes it stand apart from nearly every other SCM out there is its branching model.

    Git allows and encourages you to have multiple local branches that can be entirely independent of each other. The creation, merging, and deletion of those lines of development takes seconds.

    This means that you can do things like:

    • Frictionless Context Switching. Create a branch to try out an idea, commit a few times, switch back to where you branched from, apply a patch, switch back to where you are experimenting, and merge it in.
    • Role-Based Codelines. Have a branch that always contains only what goes to production, another that you merge work into for testing, and several smaller ones for day to day work.
    • Feature Based Workflow. Create new branches for each new feature you're working on so you can seamlessly switch back and forth between them, then delete each branch when that feature gets merged into your main line.
    • Disposable Experimentation. Create a branch to experiment in, realize it's not going to work, and just delete it - abandoning the work—with nobody else ever seeing it (even if you've pushed other branches in the meantime).

    Notably, when you push to a remote repository, you do not have to push all of your branches. You can choose to share just one of your branches, a few of them, or all of them. This tends to free people to try new ideas without worrying about having to plan how and when they are going to merge it in or share it with others.

    There are ways to accomplish some of this with other systems, but the work involved is much more difficult and error-prone. Git makes this process incredibly easy and it changes the way most developers work when they learn it.

  • 相关阅读:
    lilntcode-508-摆动排序
    lintcode-501-迷你推特
    lintcode-496-玩具工厂
    lintcode-491-回文数
    lintcode-488-快乐数
    lintcode-480-二叉树的所有路径
    lintcode-248-统计比给定整数小的数的个数
    ubuntu 镜像站部署
    [转发]以我的亲身经历为例,告诉大家写简历和面试的技巧(面向高级开发和架构师)
    镜像站nginx
  • 原文地址:https://www.cnblogs.com/oxspirt/p/6104864.html
Copyright © 2011-2022 走看看