Resolve conflicts · Merge requests · Project · User · Help · GitLab

文章推薦指數: 80 %
投票人數:10人

Resolve conflicts: interactive mode ... Introduced in GitLab 8.11. ... Once all conflicts have been marked as using 'ours' or 'theirs', the conflict can be resolved ... Help Help Mergerequestconflictresolution Mergeconflictsoccurwhentwobrancheshavedifferentchangesthatcannotbe mergedautomatically. Gitisabletoautomaticallymergechangesbetweenbranchesinmostcases,but therearesituationswhereGitwillrequireyourassistancetoresolvethe conflictsmanually.Typically,thisisnecessarywhenpeoplechangethesame partsofthesamefiles. GitLabwillpreventmergerequestsfrombeingmergeduntilallconflictsare resolved.Conflictscanberesolvedlocally,orinmanycaseswithinGitLab (seeconflictsavailableforresolution forinformationonwhenthisisavailable). NOTE:Note: GitLabresolvesconflictsbycreatingamergecommitinthesourcebranchthat isnotautomaticallymergedintothetargetbranch.Thisallowsthemerge committobereviewedandtestedbeforethechangesaremerged,preventing unintendedchangesenteringthetargetbranchwithoutrevieworbreakingthe build. Resolveconflicts:interactivemode IntroducedinGitLab8.11. Clickingthiswillshowalistoffileswithconflicts,withconflictsections highlighted: Onceallconflictshavebeenmarkedasusing'ours'or'theirs',theconflict canberesolved.Thiswillperformamergeofthetargetbranchofthemerge requestintothesourcebranch,resolvingtheconflictsusingtheoptions chosen.Ifthesourcebranchisfeatureandthetargetbranchismaster, thisissimilartoperforminggitcheckoutfeature;gitmergemasterlocally. Resolveconflicts:inlineeditor IntroducedinGitLab8.13. Themergeconflictresolutioneditorallowsformorecomplexmergeconflicts, whichrequiretheusertomanuallymodifyafileinordertoresolveaconflict, tobesolvedrightformtheGitLabinterface.UsetheEditinlinebutton toopentheeditor.Onceyou'resureaboutyourchanges,hitthe Committosourcebranchbutton. Conflictsavailableforresolution GitLaballowsresolvingconflictsinafilewhereallofthebelowaretrue: Thefileistext,notbinary ThefileisinaUTF-8compatibleencoding Thefiledoesnotalreadycontainconflictmarkers Thefile,withconflictmarkersadded,isnotover200KBinsize Thefileexistsunderthesamepathinbothbranches Ifanyfilewithconflictsinthatmergerequestdoesnotmeetallofthese criteria,theconflictsforthatmergerequestcannotberesolvedintheUI. Additionally,GitLabdoesnotdetectconflictsinrenamesawayfromapath.For example,thiswillnotcreateaconflict:onbrancha,doinggitmvfile1file2;onbranchb,doinggitmvfile1file3.Instead,bothfileswillbe presentinthebranchafterthemergerequestismerged.



請為這篇文章評分?