You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Note: If using ssh you need to enable extended globbbing in the following way and use ^ to negate the pattern
git clone git@server.com:old-project.git
git clone git@server.com:new-project.git
# If you want the old project to be a subdirectory of the new project, add this: !(old-project) is a bashism that says “everything but old-project”. If your project is called the girl, then you move “everything but the girl”.cd old-project
mkdir old-project
git mv !(old-project) old-project
# Note: If using ssh you need to enable extended globbbing in the following way and use ^ to negate the pattern
setopt extendedglob
git mv ^old-project old-project
# or
git mv ^(old-project|something-else) old-project
# commit the move
git commit -a -S -m “Moving old project into its own subdirectory”
# Now comes the merging part. What we’re doing is add a remote to the old project, and merge everything into the new one. Since git doesn’t allow merges without a common history, we’ll have to force it using the allow-unrelated-histories option. And since we love well-maintained projects, we’re doing everything in a branch we’ll merge after a code review is done.cd ../new-project
git remote add old-project ../old-project
git fetch old-project
git checkout -b feature/merge-old-project
git merge -S --allow-unrelated-histories old-project/master
git push origin feature/merge-old-project
git remote rm old-project
Try to see file history for new old project files. Only merge commit will be shown in the ui. This is because in order to see sub-tree merged repository history fully, git commands need --follow flag. Logs show that it is added but soon after another flag is added --first-parent which returns command to default behavior.
The text was updated successfully, but these errors were encountered:
Output:
Steps to Reproduce:
--follow
flag. Logs show that it is added but soon after another flag is added--first-parent
which returns command to default behavior.The text was updated successfully, but these errors were encountered: