Andrew Fletcher published: 21 June 2023 2 minutes read
I'm in an environment where the default branch is staging and I'm attempting to run a git merge. However, in actioning this command, I'm been greeted with the following response 'not something we can merge'
❯ git merge origin/{branch}
merge: origin/{branch} - not something we can merge
To resolve this, first I attempted to do a git checkout to the branch
But this was swiftly meet with "did not match any file(s) known to git"
git checkout {branch}
error: pathspec '{branch}' did not match any file(s) known to git
Git hasn't 'seen' the new branch. This is where git fetch comes into play.
❯ git fetch origin {branch}
remote: Counting objects: 9, done.
Unpacking objects: 100% (9/9), 721 bytes | 103.00 KiB/s, done.
From https://git-codecommit.ap-southeast.amazonaws.com/v1/repos/{name}
* branch {branch} -> FETCH_HEAD
* [new branch] {branch} -> origin/{branch}
With the branch recognised
❯ git checkout {branch}
branch '{branch}' set up to track 'origin/{branch}'.
Switched to a new branch '{branch}'
Switch back to your original branch that you wanted to merge. In my situation I was staging
❯ git checkout staging
Switched to branch 'staging'
Your branch is up to date with 'origin/staging'.
Now I can merge and with success. Try again. to run git merge
❯ git merge origin/{branch}
Auto-merging web/themes/custom/{project}/... {file path to change(s)}
Merge made by the 'ort' strategy.
web/themes/custom/{project}/{file-path-to-change} | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Related articles
Andrew Fletcher
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...
Andrew Fletcher
•
05 Apr 2024
Drupal 9 to 10 upgrade an example of the actual steps taken
Continuing on from the Drupal 9 to Drupal 10 upgrade outline written earlier... Upgrading Drupal 9 to Drupal 10. However, the point of difference is this article works through the actual action steps of the upgrade.Planning and testing is critical for the Drupal to version 10 process to...
Andrew Fletcher
•
18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...