美文网首页
Github命令

Github命令

作者: 前端混合开发 | 来源:发表于2019-05-15 10:48 被阅读0次

    删除已经push的commit:

    ~head表示之前的编号
    git rebase -i  ~head//表示回退到之前的版本,并在之后会提交需要的所有提交。
    git push --force
    

    如何将一个分支的修改同步到另一个分支?:

    将A merge 到B
    git checkout B
    git merge A
    

    如果还是不行,可以采用如下办法:

    git将主干合并到当前分支时,出现如下结果:
    
    原因在于:执行git merge前,主干的代码没有更新
    
    正确的操作步骤如下:
    
    1 .切换到主干
    
     $ git checkout master
    
     2\. 更新主干代码
    
     $ git pull origin master
    
    3\. 切换回分支
    
     $ git checkout feature/20170527_894373_inventory_order_export_1
    
    4\. 执行合并操作
    
     $ git merge master
    
     这样就对了,剩下的就是解决冲突,然后提交代码
    
    

    Creating your very first Workspace
    An intro to ZenHub Epics

    git查看当前分支所属

    1、git branch -vv
    
    2、git config --lis
    
    image.png

    新建分支

    fatal: The current branch Cloud has no upstream branch.
    To push the current branch and set the remote as upstream, use
        git push --set-upstream origin IBM-Cloud
    

    相关文章

      网友评论

          本文标题:Github命令

          本文链接:https://www.haomeiwen.com/subject/tsmuaqtx.html