Marco Song Marco Song - 10 months ago 36
Git Question

Git: How to create file to a certain path from terminal

I want to add a file to git from terminal.

Like answer to the question below, I want to create

file manually

But git touch config/database.yml not work for me
Anyone could help? Thanks

Capistrano: linked file database.yml does not exist on my.server.ipadress

Answer Source

You can do this by installing git-extras from

One of the commands this adds is git touch and as documented here and this does exactly what you wish:


Call touch on the given file and add it to the current index. Used one-step creating new files.

Here it is in action:

enter image description here