error: pathspec did not match any file(s) known to git
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
sudo docker ps and exec -it
Working in an AWS ec2 environment, my goal is to access the server via terminal.
I initially work to get the instance ID. With this ID, I'm able to connect to the server. When first accessing the environment on the server the steps I take are:
sudo docker ps
ps - refers to the 'process status'
Response
Exporting a MySQL table to a file
Goal: I want to download a table list to a txt or csv file.
Initially, as a root user I tried using drush
drush sql-dump --tables-list=media_field_data > db-list.sql
Of course as a root user and Drush set-up not as root. failed with
Command 'drush' not found, did you mean:
command 'rush' from deb rush (1.8+dfsg-1.1)
My bad.
homebrew for speed tests
Using Homebrew for speed tests...
I'm using Speediest CLI - for more details go to https://github.com/sivel/speedtest-cli
To install speedtest CLI is is quick by running the following
brew install speedtest-cli
I had a few brew updates required as you'll see by the response below
How to create list of files that is recursive and output as txt file?
This issue
I have a folder with about 10,000 files in it. I want to scan through the directories and isolate files that are different from what sits in the database. How do you generate a list of file names of all the files into a single txt file?
how to solve - git response 'not something we can merge'
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
Count the number of files in a directory including recursively
How to count the number of files in a directory. At some point you'll have a directory or directories that you need to know the number of files in them. On Linux, the list command (ls) is piped with the wc -l command.
ls | wc -l
This command works great if all the files are located in one directory. What about if you have multiple directories. Then you will need to use the find command piped with the wc command
how to update composer
Looking at composer I first wanted to check the current version, which is actioned by running the following command
composer -V
The response I was seeing
Composer version 2.1.5 2021-07-23 10:35:47
Updating dependencies in Composer
This article works through the steps to update dependencies in the composer.json file to the latest version.
Use composer outdated to suggest the latest versions.
composer outdated
Whereas, to return a complete list of packages where packages that need an update are coloured red, the up-to-date ones are coloured green
composer show -l
Using bash script to overwrite files and directories
I had generated a backup of key directories on the server - see Create a Ubuntu backup shell script. With a backup in hand, now it was time to test how to unpack a backup and overwrite the directories.
First I unpacked the backup to a temporary directory tmp-cc.