使用git rebase -i压缩单个分支上的提交,遇到合并冲突

时间:2019-06-13 23:05:46

标签: git

有人要求我使用git rebase -i从几周前将一组4-5个连续的提交压缩为1个提交。从那以后有一些提交。因此,在下图中,我想将B到F的提交压缩为一个提交:

A - B - C - D - E - F - G - H - I ...
    |               |
    - Want to squash- 

我跑步

  

git rebase -i 8007a14d

(其中8007a14d是A的哈希),找到我要压缩的提交,然后关闭文件。但是,关闭后,我被要求解决几个合并冲突。不太熟悉提交G之前的代码,我决定中止。

这对我来说有点奇怪。我想象git会按照提交的顺序重播提交/差异。作为健全性检查,我尝试了git rebase并将所有提交保留为“ pick”,但仍然遇到合并冲突。有人可以帮助我理解这一点吗?谢谢!

1 个答案:

答案 0 :(得分:0)

假设我在时间上是最新的分支机构

    byte[] buffer = readFile( docPdf);
    String docBase64 = Base64.getEncoder().encodeToString(buffer);

    // Create the DocuSign document object
    Document document = new Document();
    document.setDocumentBase64(docBase64);
    document.setName(docPdf); 
    // can be different from actual file name
    document.setFileExtension("pdf");
    document.setTransformPdfFields("true");
    // many different document types are accepted
    document.setDocumentId("1"); 
    // a label used to reference the doc


    ArrayList<CompositeTemplate> compList = new ArrayList<CompositeTemplate>();
    CompositeTemplate compoTemplate = new CompositeTemplate();

       //Add to Composite template
    compoTemplate.setDocument(document);

    //Create Envelope recipients, including them in the first template
    ArrayList<Signer> signers= new ArrayList<Signer>();

    Signer signer1 = new Signer ();
    signer1.setEmail("***@***");
    signer1.setName("Jane Doe");
    signer1.setRecipientId("1");
    signer1.setRoleName("Test");
    signer1.setRoutingOrder("1");


    SignHere signHere1 = new SignHere();
    signHere1.setTabLabel("aaa");
    signHere1.setRecipientId("1");
    signHere1.setDocumentId("1");
    signHere1.setPageNumber("6");

    Tabs recipientTabs = new Tabs();
    recipientTabs.setSignHereTabs(Arrays.asList(signHere1));

    signer1.setTabs(recipientTabs);

    signers.add(signer1);

    Recipients recipientList = new Recipients();
    recipientList.signers(signers);

    //Create the list for InlineTemplates


    ArrayList<InlineTemplate> inlineTemplateList = new ArrayList<InlineTemplate>();
    InlineTemplate inlineTemplate = new InlineTemplate();
    inlineTemplate.setSequence ( "1");
    inlineTemplate.setRecipients(recipientList);

    inlineTemplateList.add(inlineTemplate);

    //Create the composite template, inline template lists.
    compoTemplate.setCompositeTemplateId("1");
    //compoTemplate.ServerTemplates = templateList;
    compoTemplate.setInlineTemplates(inlineTemplateList);

    //Take the Composite Template list, add both 

    compList.add(compoTemplate);

    //Create the definition for the envelope
    EnvelopeDefinition  envelopeDefinition = new EnvelopeDefinition();
    //Add the Composite Template list
   // envelopeDefinition.setCompositeTemplates(templateList);
    envelopeDefinition.setEmailSubject("composite ***** ");
    envelopeDefinition.setCompositeTemplates(Arrays.asList(compoTemplate));
  //  envelopeDefinition.setRecipients(recipientList);

    envelopeDefinition.setStatus("sent"); // requests that the envelope be created and sent.

现在您完成了。