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
Asked
Active
Viewed 110 times
0
2 Answers
1
Try
touch config/database.yml
instead of
git touch config/database.yml

Deepak
- 850
- 5
- 13
-
I want to create directly to git – Bye Oct 14 '16 at 09:47
-
By git, you mean github ? – Deepak Oct 14 '16 at 10:25
1
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:

Ashutosh Jindal
- 18,501
- 4
- 62
- 91