Closed TimidRobot closed 2 years ago
Goal: merge deleted file with full history with copy in the creativecommons/vocabulary-styles repo (which did not include full history 🤦🏻 ):
packages/vocabulary/src/styles/header.scss
src/styles/header.scss
git checkout eb60730128 -b temp-eb60730128
mkdir -p src/styles
git mv packages/vocabulary/src/styles/header.scss src/styles/header.scss
git commit -m'move file into cherry-pick directory'
SAVED=$(git rev-parse HEAD)
git checkout -b reintegration-example main
git merge ${SAVED}
git add src/styles/header.scss
git commit -m'restore file'
git remote add vocabulary-styles https://github.com/creativecommons/vocabulary-styles.git
git remote update
git cherry-pick -Xtheirs ca73e9b411f8d187cd10468b340615606b0dd8a6
git cherry-pick -Xtheirs 6d2b73a320972822a126790a1f18502c9e751bee
git cherry-pick -Xtheirs fdfc5486b972621fb9c060af78992c31eb7ad991
git cherry-pick -Xtheirs f385e0e57de81074405fa87ec0279f8feaf86a67
mkdir -p src/scss
git mv src/styles/header.scss src/scss/header.scss
git commit -m'move file to final destination'
Verify history:
git log --follow src/scss/header.scss
commit 96c7de92340cad65987e6285a3c9e12ced89d589 (HEAD -> reintegration-example) Author: Timid Robot Zehta <timid@creativecommons.org> Date: 2022-09-22 09:55:54 -0700 move file to final destination commit d4384730527cfaae98182efdac97d6019cf44988 Author: Brylie Christopher Oxley <brylie@creativecommons.org> Date: 2022-03-04 14:27:30 +0200 Remove mobile() and tablet() commit 2857737578cef33fdb8a319f80655e84966a3537 Author: Brylie Christopher Oxley <brylie@creativecommons.org> Date: 2022-03-04 14:08:34 +0200 Set .navbar-brand margin-left to auto commit 174fac55aa84cf95171dcc76c8f9eb3281281f55 Author: Brylie Christopher Oxley <brylie@creativecommons.org> Date: 2022-03-04 13:32:21 +0200 Remove breakpoint-specific overrides commit 184865e4f7f8c52e4c2d46374281cc506cefa2db Author: Brylie Christopher Oxley <brylie@creativecommons.org> Date: 2022-03-04 13:29:07 +0200 Remove breakpoint override commit 6e49449880c90f236c512ce0be935834968adf1b (temp-eb60730128) Author: Timid Robot Zehta <timid@creativecommons.org> Date: 2022-09-22 09:53:42 -0700 move file into cherry-pick directory commit 897907c94163be0140843fd6650d360ca028f1ea Author: Dhruv Bhanushali <dhruv_b@live.com> Date: 2021-07-18 17:53:29 +0530 Relocate SCSS stylesheets commit fdd70e3f3e3144281871722fd6f2b0f68d17b95f Author: Zack Krida <zackkrida@pm.me> Date: 2020-11-20 07:44:23 -1000 Remove fullhd top padding [...]
git branch -D temp-eb60730128
src/scss/header.scss
git cherry-pick -Xtheirs
The -Xtheirs option forces conflicting hunks to be auto-resolved cleanly by favoring their version. Changes from our tree that do not conflict with their side are reflected in the merge result. (Adapted from Git - git-merge Documentation)
-Xtheirs
git log --all --full-history -- packages/vocabulary/src/styles/header.scss
Description
Goal: merge deleted file with full history with copy in the creativecommons/vocabulary-styles repo (which did not include full history 🤦🏻 ):
packages/vocabulary/src/styles/header.scss
(last commit before it was deleted)src/styles/header.scss
(current commit when this issues was created)Process
packages/vocabulary/src/styles/header.scss
prior to deletionsrc/styles/header.scss
since that repository was created:Verify history:
Result
src/scss/header.scss
historygit cherry-pick -Xtheirs
The
-Xtheirs
option forces conflicting hunks to be auto-resolved cleanly by favoring their version. Changes from our tree that do not conflict with their side are reflected in the merge result. (Adapted from Git - git-merge Documentation)Viewing full history of a deleted file
Related Links