Fixing .gitignore functional error during commit

Posted By : Shiv Kumar | 29-Sep-2014

Sometimes we add some files in our .gitignore to avoid them from commit but still they appeared in our changes to commit and violat .gitignore.

Here are four easy steps to make .gitignore functional again :

Caution : Be aware to commit all your changes before or backup them, otherwise you will loose control on all the changed files that may be important to you.

Step 1 : git rm -r --cached .       // This will remove any changed files from the index.

Step 2 : git add .		       // To add the changes file to commit

Step 3 : git commit -m "fixed .gitignore issue"  

Step 4 : git push origin master(your working branch)

Now added files to .gitignore will never appear in your changes to commit.

Thanks

Shiv Kumar

About Author

Author Image
Shiv Kumar

Shiv is an experienced Java Developer with a strong background in multiple technologies. He specializes in defining system architectures to ensure reliable and resilient solutions. He possesses a comprehensive understanding of the latest technologies and has hands-on experience in Core Java, Spring Boot, Hibernate, Apache Kafka messaging queue, Redis, as well as relational databases like MySQL and PostgreSQL, and non-relational databases like MongoDB. He excels in API implementations, Microservices, Web Services development, testing, and deployments. Shiv actively contributes to code enhancements and consistently delivers valuable contributions to various client projects, including Fabtrack, Pando, Pandojo, Digikam, WhatsApp Integration, Croniz, Punchin Application, Script TV, Bhaasha, and more. He demonstrates strong analytical skills and a creative mindset. In addition, he has a passion for reading books and exploring new technologies and innovations.

Request for Proposal

Name is required

Comment is required

Sending message..