Bye
Bye

Reputation: 768

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 /home/deploy/myrailsapp/shared/config/database.yml 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

Upvotes: 0

Views: 217

Answers (2)

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

You can do this by installing git-extras from https://github.com/tj/git-extras/blob/master/Installation.md

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

DESCRIPTION

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

Upvotes: 1

Deepak
Deepak

Reputation: 870

Try

touch config/database.yml

instead of

git touch config/database.yml

Upvotes: 1

Related Questions