Marco Song Marco Song - 1 year ago 71
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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download