When i merge two branches seeding from master. It auto merges file and
creates duplicate code because of newline in second branch with same code
without showing conflict.
Scenario:
1. add new source code file into master branch text.cs and add sample C#
code up to 1000 lines .
2. Seed new branch called develop1 from master and at line number 245
add below content as it is with spaces and commit it on develop1.this does
not have newline before comment.
File 1 - Line 245 :
public int? realPortNum
{
get { return valueForKey<int?>("realPortNum"); }
set { takeValueForKey("realPortNum", value); }
}
//ADSO-3530 - line 245
public Decimal? tradeItemDryPhyWetQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.wetQty : 0;
}
}
public Decimal? tradeItemDryPhyDryQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.dryQty : 0;
}
}
1. Seed new branch called develop2 from master and at line number 245
add below content as it is with spaces and commit it on develop2. this has
newline before comment.
File 2 - Line 245 :
public int? realPortNum
{
get { return valueForKey<int?>("realPortNum"); }
set { takeValueForKey("realPortNum", value); }
}
//ADSO-3530 - line 246
public Decimal? tradeItemDryPhyWetQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.wetQty : 0;
}
}
public Decimal? tradeItemDryPhyDryQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.dryQty : 0;
}
}
1. Now merge develop1 and develop2. Ouput creates auto merge result
which is not recommended in general practice without showing any conflict.
Merged File - Line 245, after //ADSO-3530 functions are duplicated :
public int? realPortNum
{
get { return valueForKey<int?>("realPortNum"); }
set { takeValueForKey("realPortNum", value); }
}
//ADSO-3530
public Decimal? tradeItemDryPhyWetQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.wetQty : 0;
}
}
public Decimal? tradeItemDryPhyDryQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.dryQty : 0;
}
}
//ADSO-3530
public Decimal? tradeItemDryPhyWetQty
{
get
{
return (tradeItemDryPhy != null)? tradeItemDryPhy.wetQty : 0;
}
}
public Decimal? tradeItemDryPhyDryQty
{
get
{
return (tradeItemDryPhy != null) ? tradeItemDryPhy.dryQty : 0;
}
}
Someone Please advise on Git Auto Merge precautionary strategy when there
is so many branches and merges are mandatory, how to avoid above type of
auto merge issues?
--
You received this message because you are subscribed to the Google Groups
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/gitlabhq/a48d37dd-21bf-440d-bee7-3962a322390b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.