Force merge in Git - Medium

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

Force merge in Git · 1. create copy (for backup). // go to feature branch git switch(or checkout) feature// create new branch git branch feature · 2. in feature. GetunlimitedaccessOpeninappHomeNotificationsListsStoriesWriteForcemergeinGitPhotobyRomanSynkevychonUnsplashThisisthelastwaytodealwithmergeconflicts.PleasereadthestorybelowaswellifyouareinterestedinhowIcouldavoidthisproblem.GitHub:WeAreSaveMainRepositoryCommitteeThisismymemoafterIcompletelycrushedthemainrepoandre-learnedhowIcouldavoidthemiserableaccident(the…medium.comAssumewewanttomergefeaturetomainbutthatisimpossible.1.createcopy(forbackup)//gotofeaturebranchgitswitch(orcheckout)feature//createnewbranchgitbranchfeature2.infeature//forcemergegitmerge-soursmain3.inmaingitmergefeatureexample:whenweforcemergedmainandrelease/0.1.0635gitcheckoutrelease/0.1.0636gitcheckout-brelease/0.1.1637gitbranch638gitcheckoutrelease/0.1.0639gitmerge-soursmain640gitcheckoutmain641gitmergerelease/0.1.0642gitstatus643gitbranch644gitadd.645gitcommit-m"mergedrelease/0.1.0tomain"646gitpushoriginmainConclusionThisproblemwascausedbyaconfusionofcommitmentflow.Bothbranchessomehowhadaheadcommitsandthat’swhyIcouldnotmerge.WhatIlearnedfromthisproblemisthatwealwayshavetobeawareofthelatestcommitoftherootbranchandwhatbranchweneedtomerge.Ihopenobodyneedsthisinformation,though.PleasereadthestorybelowaswellifyouareinterestedinwhatexactlyIlearnedfromthisproblem.MorefromLada496FollowAwebdevelopmentandEnglishlearner.I’mhappyifyougivemesomefeedback:)Lovepodcastsoraudiobooks?Learnonthegowithournewapp.TryKnowableRecommendedfromMediumYogeshNileHowtocreatecustomdomainAPIinAWSAPIGatewayDharikPatelinMagooshStoriesWhatIt’sLiketoBeonMagoosh’s(Tiny)EngineeringTeamEmmaLovesWeddings20AdorableFlowerGirlDressesforYourWeddingDayIhorKosandiakinORILSoftwareSpringBoot+PayPal+Angular2EmreAyarinJavarevisitedLet’sLearnTogetherSessions:JavaStreamAPIFerdinaKusumahPleasestopusingloopinpython!!WillStauntoninCommerceBear✨Teamhighlight:welcomingCam!vigneshmCreatinganRHELserverathomeAboutHelpTermsPrivacyGettheMediumappGetstartedLada49612FollowersAwebdevelopmentandEnglishlearner.I’mhappyifyougivemesomefeedback:)FollowMorefromMediumMohomedRikasGitCommandsEveryDeveloperShouldKnowEvelynValeriaCarrilloPérezCREATEDATABASEMySQLwithC#&WinFormsIsmailKarabulutGettingstartedwithUNIXAnjarulRobinGitinternals(Part1)HelpStatusWritersBlogCareersPrivacyTermsAboutKnowable



請為這篇文章評分?