Creating a .gitignore file on the Command Line

creating a .gitignore file and ignoring a file in the terminal.
  • I have a repository that has one file and one folder.
  • I create a .gitignore file using the command
>> .gitignore
  • I create a README file with the same command but I add
>> README.md echo 'This application shows a calendar in a grid form'
  • I then create a file called ignoreme.html just to illustrate how the .gitignor e file works (I could’ve used the README.md file for that purpose but let’s face it, no one should be ignoring a readme file. That would be utterly reckless!).
  • I then add the newly created file to the .gitignore file right in the terminal! with the echo command as earlier seen:
echo 'ignoreme.html' > .gitignore
echo folder_to_ignore/ >> .gitignore

--

--

--

I am a budding data scientist with a background in web development. HTML, CSS, JavaScript, Python. Cat lover, Nature enthusiast.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

SOLID Principles

Conway’s Game of Life: Kick starting Bootcamp

30 Days of Canonic: It’s a wrap!

A Guide to creating an API Endpoint with Django Rest Framework and Django Filters with PostgreSQL

Making Restart of Httpd Service Idempotent in Ansible Playbook

SonarQube with declarative Jenkins Pipeline

Demystifying Exchange Hybrid Mailbox Delegate Permissions

Oracle Database Cloud Service- Useful CLI — Part1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eva. N

Eva. N

I am a budding data scientist with a background in web development. HTML, CSS, JavaScript, Python. Cat lover, Nature enthusiast.

More from Medium

10+ Free YouTube Channels to Sharpen Your Programming Skills in 2022

Illustrated screenshot of a youtube video. A youtube screen sits around an image of a woman on a computer.

ULTIMATE GUIDE TO GIT AND GITHUB

UML class diagrams

Get started with GIT