Skip to main content

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

mysql dump FLUSH TABLES access denied

I've recently upgraded the server Ubuntu 20.04 updating the PHP version from 7.4 to 8.1.  However, when I've attempted to export the MySQL database using the command

drush sql-dump --extra-dump=--no-tablespaces --result-file=../sql/db-2023-02-25.sql

I seeing the following response

Creating a bash script and executing it on OSX

Creating a bash script

Bash scripts are files containing code that tell your computer to do something.  In this instance, I want to rename a batch files in a directory.  Such as changing:
 

37351001 - BlueSpotted.jpg
37351008 -SpangledEmporer _ 0133A.jpg
37353003 -Black-Bream_3481 .jpg
37353004   -35 - Yellowfin.jpg

Instead having these files appear as:

How to synchronize two remote Git repositories

Currently, I have a situation where I have two repositories.  The first is where I've held the code since the beginning.  The second has come on board recently and is the client repo.  However, rather than shut the original down, I want to keep both running with the same code.  How do I synchronise them so that they contain the same thing?

OSX : Convert a putty .ppk key to a .pem file

How do you generate a .pem file from an existing .ppk key?

Is putty on your mac?

Check by running the command

puttygen -V

Which will generate a response similar to 

puttygen: Release 0.76
Build platform: 64-bit Unix
Compiler: clang 12.0.5 (clang-1205.0.22.9)
Source commit: 1fd7baa7344bb....

Don't have Putty, well easily fixed with homebrew.

npm dependencies and devDependencies

Currently I'm working through an app that has been abandoned by the developers.  The client was getting no response from the dev company, when they asked if I could have a look.  The app hadn't been updated for 18 months.  So of course, a product that hasn't been updated in that timeframe is going to have a suite of npm update issues / conflicts.

 

Empty a file using command

First off, this isn't the only method to achieve the outcome of emptying a file.

Using a symbol : is a shell built-in command that is essence equivalent to the true command and it can be used as a no-op (no operation).  It can be used as follows:

# : > filename.txt

OR 

# true > filename.txt

 

My initial file was as follows:

21548342 16 Mar 20:27 code.log

Post using the command 

Subscribe to iTerm2