Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何将更改推送到嵌套子树?_Git_Github - Fatal编程技术网

Git 如何将更改推送到嵌套子树?

Git 如何将更改推送到嵌套子树?,git,github,Git,Github,我有4个项目叫 数学 摄像机 CGOpenGL OpenGLSandbox Math是Camera的子树,Camera是CGOpenGL的子树,最后CGOpenGL是OpenGLSandbox 当我在OpenGLSandbox中工作时,我需要对数学进行一些更改。完成更改后,我执行了git commit-am“bla bla”和git push这是在顶级目录下执行的,即OpenGLSandbox 重要的是,我添加了三个遥控器 玛斯指向数学的报告 ropengl指向CGOpenGL的回购 OpenG

我有4个项目叫

  • 数学
  • 摄像机
  • CGOpenGL
  • OpenGLSandbox
  • MathCamera的子树,CameraCGOpenGL的子树,最后CGOpenGLOpenGLSandbox

    当我在OpenGLSandbox中工作时,我需要对数学进行一些更改。完成更改后,我执行了
    git commit-am“bla bla”
    git push
    这是在顶级目录下执行的,即OpenGLSandbox

    重要的是,我添加了三个遥控器

  • 玛斯指向数学的报告
  • ropengl指向CGOpenGL的回购
  • OpenGLSandbox回购的原点
  • 在上一次提交主项目(OpenGLSandbox)后,我想将更改从Math推送到它的存储库,因此我尝试了git subtree push--prefix=cgopengl/camera/Math-Math-master

    a)prefix的值是我们要推送的子树项目的路径?

    上一个命令以以下错误结束

     ! [rejected]        f60f3e788d6e8713a525cab0fe187f5f3b230b8e -> master (non-fast-forward) 
     error: failed to push some refs to 'https://github.com/user123/Math.git' 
     hint: Updates were rejected because the tip of your current branch is behind 
     hint: its remote counterpart. Integrate the remote changes (e.g. 
     hint: 'git pull ...') before pushing again.
    
    fatal: refusing to merge unrelated histories
    
    因此,我尝试使用git subtree pull--prefix=cgopengl/camera/math-rmath-master进行一次拉取,结果出现以下错误

     ! [rejected]        f60f3e788d6e8713a525cab0fe187f5f3b230b8e -> master (non-fast-forward) 
     error: failed to push some refs to 'https://github.com/user123/Math.git' 
     hint: Updates were rejected because the tip of your current branch is behind 
     hint: its remote counterpart. Integrate the remote changes (e.g. 
     hint: 'git pull ...') before pushing again.
    
    fatal: refusing to merge unrelated histories
    
    b)如何推动OpenGLSandbox项目对数学所做的更改?我找不到克服这一点的办法。我在哪里犯了错误?