如果在两者之间删除提交会发生什么?

时间:2016-06-29 14:35:42

标签: git

想象一下,我正在做git rebase -i 63569c41040b8fecce5c43a40745888c0283f429

pick b444c0b second
pick 604539e third

# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit

第一次提交添加了一个文件example.txt,内容为:

a

第二次提交将文件example.txt修改为

a1
b
c

第三次提交将文件example.txt更改为

d
a1
cx

第二次提交被删除后会发生什么?文件example.txt的内容是什么?

1 个答案:

答案 0 :(得分:0)

我刚尝试过:

 //Parent Form
public partial class AddNewAccount : DevExpress.XtraEditors.XtraForm
{
    Thread thrd;
    private void brnContinue_Click(object sender, EventArgs e)
    {
        Worker workerObject = new Worker(this);
        //ThreadStart ts = new ThreadStart(workerObject.DoWork);
        //thrd = new Thread(ts);

        Thread thrd = new Thread(() =>
        {
           //workerObject.DoWork();  // CrossThreadException
           Invoke(new MethodInvoker(workerObject.DoWork));  // OK
        });

        //some code here
        addNewAccount();    
    }

    private void addNewAccount()
    {
        //parameter define here and pass in verifyDetails
        thrd.Start();   
        validatorClass objClass = new validatorClass();
        Bool isSuccess = false;
        isSuccess = objClass.verifyDetails(parameters); //it will verify all the details. May take upto a 30 seconds
    }
}

//worker class
public class Worker
{
    Form parentForm
    InformationFetching frmChild;
    Bool isTestCall = false;1
    public Worker(Form prntForm)
    {
        // TODO: Complete member initialization
        parentForm = prntForm;
    }
    public void DoWork()
    {
        //child form
        if(isTestCall)
            InformationFetching frmChild = new InformationFetching(0) 
        else
            InformationFetching frmChild = new InformationFetching(1) //1 is when small verification
        //getting error of cross-thread
        frmChild.MdiParent = parentForm;
        frmChild.StartPosition = FormStartPosition.CenterParent;
        frmChild.ShowDialog();
    }
}

//validator class
public class validatorClass
{
    // verify all the details one by one and fetch in InformationFetching form
    internal void verifyDetails()
    {
        //phase-1 verification
        AccountSyncform().showInfo("Information");

        //phase-2 verification
        AccountSyncform().showInfo("Information");

        //phase-3 verification
        AccountSyncform().showInfo("Information");

        //phase-4 verification
        AccountSyncform().showInfo("Information");

        //phase-5 verification
        AccountSyncform().showInfo("Information");
    }

    public InformationFetching AccountSyncform()
    {
        InformationFetching mForm = null;
        try
        {
            foreach (System.Windows.Forms.Form f in System.Windows.Forms.Application.OpenForms)
                if (f.Name == "InformationFetching")
                { mForm = (InformationFetching)f; break; }
        }
        catch (Exception ex)
        {
            MainTainErrorLog.addGeneralErrorToLog(ex.Message);
        }
        return mForm;
    }
}

interactive rebase in progress; onto 63569c4
Last commands done (2 commands done):
   d b444c0b second
   pick 604539e Third
No commands remaining.
You are currently rebasing branch 'master' on '63569c4'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

    both modified:   example.txt

所以答案是你必须手动解决这个问题。