Changes between Version 6 and Version 7 of StartModMaint


Ignore:
Timestamp:
Dec 7, 2013, 6:37:15 PM (9 years ago)
Author:
John Maddock
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • StartModMaint

    v6 v7  
    6767}}}
    6868
     69== Merging to Master for the First Time ==
     70
     71When you are ready to merge either the develop branch (or better a release branch that's forked off from develop), there's a bit of housekeeping to be done
     72the first time (assuming your library was originally in SVN) so that future merges proceed smoothly.  We're going to create a merge point between
     73the develop and master branches so that Git knows the last point the two branches were in synch.  Once we've done that Git will perform a merge by
     74replaying the commits on develop on top of master, starting from the last known merge: in other words Git will perform the tricky stuff of figuring
     75out what to merge for us.
     76
     77Begin by navigating to the history for your library on Github, starting with branch master, for example the Config library
     78[https://github.com/boostorg/config/commits/master can be seen here].  Looking down through the commit history we can see
     79that the last merge (In SVN land) was on October 25th 2013: make a note of that date.  Now use the dropdown box to
     80change the history to point to the develop branch, [https://github.com/boostorg/config/commits/develop Config library can be seen here].
     81As you can see there have been several commits since the date above, the last before that date was on Oct 21st, click on the
     82commit message for that change to take you to the actual diff for that change, [https://github.com/boostorg/config/commit/67f6b934f161dc5da2039004986a14d9217afae4 in our example here].  The SHA1 for that commit is shown below and to the right of the commit message, in this case it's
     83{{{67f6b934f161dc5da2039004986a14d9217afae4}}}.
     84
     85Now we'll create a merge to the specific commit, begin by changing your library to the master branch:
     86
     87{{{
     88git checkout master
     89}}}
     90
     91Now create a merge to the specific commit above: since we don't really want to actually change the master branch we'll use the
     92{{{-s ours}}} option to avoid any conflicts:
     93
     94{{{
     95git merge --no-ff --no-commit -s ours 67f6b934f161dc5da2039004986a14d9217afae4
     96}}}
     97
     98You can now use {{{git status}}} and {{{git diff}}} to check for modifications, in this case there are none.
     99Now make the commit:
     100
     101{{{
     102git commit -am "Create first merge point for Git"
     103}}}
     104
     105And finish off by pushing your changes to Github
     106
     107{{{
     108git push
     109}}}
     110
     111Then navigate to your libraries history again, and check that the merge shows up, [https://github.com/boostorg/config/commits/master our config example is here].
     112You're now ready for "routine" merges to proceed as per Gitflow (or whatever other strategy you wish to use).