Andrew Fletcher published: 30 August 2023 1 minute read
Post creating a new branch in the repo, next step was to run the checkout command locally. On my local environment I ran the following command
git checkout {branch-name}
However, the response was
error: pathspec '{branch-name}' did not match any file(s) known to git
Solution
The issue while the new branch is known in the repo, it's not known in my local environment. To make the new branch known you need to run the fetch command
git fetch --all
Response
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), 922 bytes | 17.00 KiB/s, done.
From https://bitbucket.org/{path}
* [new branch] drupal-10 -> origin/drupal-10
* [new branch] feature/august-release -> origin/feature/august-release
* [new tag] 2023.06rc -> 2023.06rc
* [new tag] 2023.08rc -> 2023.08rc
Now you'll be able to run the Git checkout command
git checkout drupal-10
Response
Switched to a new branch 'drupal-10'
M content/vendor/bin/drush
branch 'drupal-10' set up to track 'origin/drupal-10'.
Related articles
Andrew Fletcher
•
20 May 2024
Create a copy of files that go to the tmp directory
To review the content of files being generated in the /tmp directory on an Ubuntu server before Microsoft Defender removes them, you can use several approaches. Following is the approach we took. Real-Time MonitoringYou can set up a script to monitor the /tmp directory and log the...
Andrew Fletcher
•
09 May 2024
Efficiently managing large file archives in Linux: excluding directories with Zip
Managing large directories, especially those filled with a diverse mix of media such as documents and images, can quickly become cumbersome. In my latest project, dealing with a directory that totals a whopping 87GB, the need for efficient file compression and selective archiving became apparent....
Andrew Fletcher
•
07 May 2024
Understanding transaction control in MySQL: A guide to START TRANSACTION, ROLLBACK and COMMIT
Recently I came across this piece of gold when dealing with databases, particularly relational ones like MySQL, managing transactions efficiently is crucial to ensure data integrity and consistency. In MySQL, transactions are used to group several SQL commands into a single unit that either...