zoukankan      html  css  js  c++  java
  • Git--将本地代码提交到服务器分支上

    原网址:https://www.cnblogs.com/sunshine2016/p/5788060.html

    直接使用git push origin [branch-name],往往会出错,有可能本地版本比分支的版本更低

    这个时候需要先将解决冲突,再将本地代码推送到服务器分支上

    1. 在自己分支cs上提交代码:

    git checkout cs

    git add .

    git commit -m "add files"

    2. 切换到master分支上,从远程服务器上拉下最新代码:

    git checkout master

    git pull

    3. 切换到cs分支上,检查是否与master分支有冲突:

    git checkout cs

    git rebase master

    4. 若有冲突,先解决冲突

    git add .

    git rebase --continue(继续解决冲突)

    反复执行这两步,直到所有冲突解决完成

    5. 将本地代码推送到远程分支上:

    git push origin cs:master

     
    分类: Git & GitHub
  • 相关阅读:
    11月7日
    11月6日
    11月5日
    11月4日
    html5
    intern
    pjtool用到的数据库----oracle范畴
    运用的jdk版本如何查看
    JAVA 一句话技巧
    [ios 开发笔记]:一句话笔记
  • 原文地址:https://www.cnblogs.com/rswl/p/8621939.html
Copyright © 2011-2022 走看看