Computers Linux Mac Programming Random

git: Please properly rename / move files and directories

I get frustrated when I browse a file from a git repository only to realize its history was lost due to improper renaming/moving of the file. It seems common for developers to manually rename/move a file in a git repository by using regular file system commands rather than git commands.

For example, let’s look at the following:

So what have we here? We start off by creating a new directory called test. We then go into the directory and start a new local git repository using git init. Next we create a new file called test.txt that contains simple text “hi”. test.txt is then added and committed to the repository. Finally, we use the mv command to rename the file to test2.txt.

git status shows us the result:

Git status after 'mv'
Result of git status

This is not what we were expecting. This shows that the original file test.txt was deleted and now there is an untracked new file called test2.txt, when it really should say that test.txt was renamed to test2.txt.

Btw, this goes for moving files as well. For example, rather than renaming the file, if it was moved to, say, a different folder, e.g. newFolder/test.txt, the result would be the same.

So how can this be solved? It’s actually not far off from the steps above. Let’s start with backtracking by reverting the rename:

Running the above commands produces the following result:

Use 'git mv' to rename/move files
Use ‘git mv’ to rename/move files

Much better, isn’t it? Renaming/moving files from git repositories the proper way will allow retention of their history, which is what we want.

Amazon Web Services Elastic Beanstalk Programming Technology

AWS: EB CLI Throws Exceptions VersionConflict and/or DistributionNotFound

When running EB CLI, do you run into the following error?

I ran into this error today. Apparently it was caused by installing AWS CLI after EB CLI:
pip install awscli
Reinstalling EB CLI solved the issue:
pip install awsebcli

js Programming React

React: react-router and dynamic page title

I have been learning React for the past few weeks, and I am loving it. I spent today learning react-router at After going through it and implementing a lot of it in my app, I realized that it did not cover one thing that I really need: dynamic page title.

I have googled and looked at different examples of how others have done it (e.g. react-document-title, document.title) but I finally decided to tinker on my own and see if I can come up with my own implementation. (I know… another one???)

My sample code will be added to the result of lesson 3 from the tutorial I linked above:



Looking at index.js, I thought why not add a title attribute on the Route nodes directly? That would be the most convenient location, in my mind.


We added it to routing, but how will App get its value? This part is easy.


That’s it.


camelCase? underscore? dashes??

I think it’s always confusing to know which to use, but I won’t get into that here. Instead, I will list the differences for future reference:

  • camelCase
  • PascalCase
  • snake_case
  • train-case
  • StUdLyCaPs
  • lowercase

Juggling multiple programming languages on a daily basis, this still gives me a headache.

Mac PHP Random

Homebrew PHP Upgrade: “configure: error: Cannot find libz”

I was routinely upgrading my packages on Homebrew when I ran into the following error:

Of course, I did the first thing I always do when running into an error, Google it! And I found this link that suggested running the following:

After that,

ran fine.