GIT | Merge (locally)

Basic merge

If you have remote-tracking branches set up locally, it's as simple as:

git checkout production
git merge development
git push origin production

If you have not yet set up remote-tracking branches, you could do something like:

git fetch origin
git checkout production     # or `git checkout -b production origin/production` if you haven't set up production branch locally
git merge origin/development
git push origin production

 

 

 


 

Lockfile package.json / package-lock.json

As per the docs:

Resolving lockfile conflicts

Occasionally, two separate npm install will create package locks that cause merge conflicts in source control systems. As of npm@5.7.0, these conflicts can be resolved by manually fixing any package.json conflicts, and then running npm install [--package-lock-only] again. npm will automatically resolve any conflicts for you and write a merged package lock that includes all the dependencies from both branches in a reasonable tree. If --package-lock-only is provided, it will do this without also modifying your local node_modules/.

To make this process seamless on git, consider installing npm-merge-driver, which will teach git how to do this itself without any user interaction. In short: $ npx npm-merge-driver install -g will let you do this, and even works with pre-npm@5.7.0 versions of npm 5, albeit a bit more noisily. Note that if package.json itself conflicts, you will have to resolve that by hand and run npm install manually, even with the merge driver.

 

 

 

 


 

Last login: Mon Aug 2 19:48:05 on ttys004
/bin/zsh
❯ /bin/zsh
git status
On branch guerillasmpAug2
nothing to commit, working tree clean
❯ cd ..
❯ ls
barracksboyssmp mrg1GuerillaTrentonAug2 stagesmp
gandolf-projects-settings.txt old-trenton stagesmpAug2
guerillapornsmp previous-trenton trentonsmpAug2
guerillasmpAug2 stageTrentonMrg1Aug2
cd stageTrentonMrg1Aug2
nvm install 14.16.1
v14.16.1 is already installed.
Now using node v14.16.1 (npm v6.14.8)
git checkout stage
Switched to branch 'stage'
Your branch is up to date with 'origin/stage'.
❯ git merge trenton-ducatti
merge: trenton-ducatti – not something we can merge

Did you mean this?
origin/trenton-ducatti
git merge origin/trenton-ducatti
Auto-merging src/pages/MainDashBoard/TopTen/TopTen.js
Auto-merging src/pages/MainDashBoard/ThemesPage/ThemesAlphabeticDisplay/ThemesAlphabeticDisplay.scss
CONFLICT (content): Merge conflict in src/pages/MainDashBoard/ThemesPage/ThemesAlphabeticDisplay/ThemesAlphabeticDisplay.scss
Auto-merging src/pages/MainDashBoard/StarsPage/StarsMainView/StarsMainView.scss
Auto-merging src/pages/MainDashBoard/MovieDetailsPage/MovieScenes/MovieScenes.scss
CONFLICT (content): Merge conflict in src/pages/MainDashBoard/MovieDetailsPage/MovieScenes/MovieScenes.scss
Auto-merging src/pages/MainDashBoard/MovieDetailsPage/MovieDetailsPage.scss
Auto-merging src/pages/MainDashBoard/MovieDetailsPage/MovieDetailsPage.js
CONFLICT (content): Merge conflict in src/pages/MainDashBoard/MovieDetailsPage/MovieDetailsPage.js
Auto-merging src/pages/MainDashBoard/MainDashboardView/MostPopular/MostPopular.scss
Auto-merging src/pages/MainDashBoard/MainDashboardHeader/MainDashboardHeader.scss
CONFLICT (content): Merge conflict in src/pages/MainDashBoard/MainDashboardHeader/MainDashboardHeader.scss
Auto-merging src/pages/MainDashBoard/MainDashboard.scss
CONFLICT (content): Merge conflict in src/pages/MainDashBoard/MainDashboard.scss
Auto-merging src/pages/MainDashBoard/JustAddedPage/JustAddedWeb/JustAddedWeb.scss
Auto-merging src/components/mobile/SideMenu/SideMenu.scss
Auto-merging src/components/mobile/MobileUserActions/MobileUserActions.scss
CONFLICT (content): Merge conflict in src/components/mobile/MobileUserActions/MobileUserActions.scss
Auto-merging src/components/UserAction/UserAction.scss
CONFLICT (content): Merge conflict in src/components/UserAction/UserAction.scss
Auto-merging src/components/Slider/Slider.scss
CONFLICT (content): Merge conflict in src/components/Slider/Slider.scss
Auto-merging src/components/SignIn/SignIn.scss
CONFLICT (content): Merge conflict in src/components/SignIn/SignIn.scss
Auto-merging src/components/PageIndicator/PageIndicator.scss
CONFLICT (content): Merge conflict in src/components/PageIndicator/PageIndicator.scss
Auto-merging src/components/MovieOverlay/MovieOverlay.scss
CONFLICT (content): Merge conflict in src/components/MovieOverlay/MovieOverlay.scss
Auto-merging src/components/MovieBoxCoverStillDisplay/MovieBoxCoverStillDisplay.scss
CONFLICT (content): Merge conflict in src/components/MovieBoxCoverStillDisplay/MovieBoxCoverStillDisplay.scss
Auto-merging src/components/MainSearch/MainSearch.scss
Auto-merging src/components/LegalNotice/LegalNotice.scss
CONFLICT (content): Merge conflict in src/components/LegalNotice/LegalNotice.scss
Auto-merging src/components/BrowseNavigation/BrowseNavigation.scss
CONFLICT (content): Merge conflict in src/components/BrowseNavigation/BrowseNavigation.scss
Auto-merging src/components/AvailableOptions/AvailableOptions.scss
Auto-merging src/components/AlphabeticView/AlphabeticView.scss
CONFLICT (content): Merge conflict in src/components/AlphabeticView/AlphabeticView.scss
Auto-merging src/App.scss
CONFLICT (content): Merge conflict in src/App.scss
Auto-merging src/App.js
CONFLICT (content): Merge conflict in src/App.js
Auto-merging package.json
CONFLICT (content): Merge conflict in package.json
Auto-merging package-lock.json
CONFLICT (content): Merge conflict in package-lock.json
Auto-merging .gitignore
Automatic merge failed; fix conflicts and then commit the result.
~/Documents/gandolf/stageTrentonMrg1Aug2 stage|merge ❯ 07:58:43 PM

 

 

Scroll to Top