Add Gitignore file to existing repo - Bug Reaper

                  Bug Reaper

Lean about Automation Testing,Selenium WebDriver,RestAssured,Appium,Jenkins,JAVA,API Automation,TestNG,Maven, Rest API, SOAP API,Linux,Maven,Security Testing,Interview Questions

Tuesday 6 February 2018

Add Gitignore file to existing repo

Take a new checkout of the existing code from Git

Add gitignore file for example

touch .gitignore

Add following

/target
.idea/
*.iml
Desktop/*
Test Results*
*.ipr
*.iws
ajcore*.txt
*/target/*
TestLogs/
/ABC.XYZ.Test.UI.Framework/target
/ABC.XYZ.Test.UI.Suites/target
/ABC.XYZ.Test.Data.Models/target/



After adding just type git status and check if unrequired files are coming up

Now add gitignore file

git add .gitignore
git commit -m "Adding gitignore file"
git push

From now on whenever you take a fresh checkout unrequired files will never come

No comments:

Post a Comment