How do I create a text file and add text to it in Git Bash?
Is there a command for that operation?
In git bash, the simplest way to create/write a file is:
echo "some text" > aNewFile
Then you can edit it:
vi aNewFile
Now, there are many editors for git : vi, nano, gedit, etc.. Typing
nano hey.txt
or
vim hey.txt
will create new hey.txt in the git repository folder(if not already created) and will open the editor for you to edit your .txt file in simple text. Then save it and you are done !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With