I am reading a book by Ethan Brown called Learning JavaScript. On Ch2 the author will start describing and teaching how to use some tools that will be interesting to learn throughout the course. One of them is git.
There is this part where he tells me to add .gitignore and add a few contents to it.
But I haven't found a way that didn't throw me errors. The passage goes as follows:
First, from your project root, initialize a repository:
$ git init
This will create a project repository for you (there’s now a hidden directory called .git in your project root).
Inevitably, there will be some files you never want tracked in version control: build artifacts, temporary files, and the like. These files can be explicitly excluded in a file called .gitignore. Go ahead and create a .gitignore file now with the following contents:
# npm debugging logs npm-debug.log* # project dependencies node_modules # OSX folder attributes .DS_Store # temporary files *.tmp *~
I was able to create the git init. That was easy. But from then on things got a little complicated.
I tried adding the .gitignore file from this resource provided by sully6768 -> How to create .gitignore file
And it worked. But I wasn't able to commit the content to .gitignore.
So pretty much my question is...
How do I make the part bellow work using Linux Terminal.
Go ahead and create a .gitignore file now with the following contents:
# npm debugging logs npm-debug.log* # project dependencies node_modules # OSX folder attributes .DS_Store # temporary files *.tmp *~
I don't know how to do that.
Thank you in advance.
Other sources investigated:
- Adding files to gitignore
- Add .gitignore to gitignore
- add #*# glob to .gitignore?
- How to create .gitignore file
Citation from: Learning JavaScript by Ethan Brown Copyright © 2015 O’Reilly Media. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.