1

I want to working with git properly but some issue are occur.On GitStatus, there files shown modified.

 modified:   dev/tests/acceptance/.gitignore
    modified:   dev/tests/acceptance/.htaccess.sample
    modified:   dev/tests/acceptance/tests/_bootstrap.php
    modified:   dev/tests/acceptance/tests/_data/lorem_ipsum.txt
    modified:   dev/tests/acceptance/tests/_suite/WYSIWYGDisabledSuite.xml
    modified:   dev/tests/acceptance/tests/_suite/suite.xml.sample
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/LICENSE.txt
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/LICENSE_AFL.txt
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/README.md
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/ActionGroup/StorefrontCustomerWishlistActionGroup.xml
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/LICENSE.txt
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/LICENSE_AFL.txt
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/README.md
    modified:   dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/Test/EndToEndB2CLoggedInUserTest.xml
    modified:   dev/tests/api-functional/.gitignore

Here my ignore file:

/dev/*   
/dev/test/*

I already studied many articles but I can't get a soluton. Reference Article:gitignore does not ignore folder

I try this command :git rm -r --cached.Now, This show the following files as deleted.So when i run git add. & git push origin master it delete from master or not?

Muhammad Ahmed
  • 215
  • 1
  • 4
  • 11

1 Answers1

1

Don't run git add after removing. Simply commit the git rm command and it'll remove it from the index. If you run git add before commiting, it'll add the staged removals back into the index.

Run the following commands to remove the files from the index and maintain the local files.

git rm --cached -r dev/tests
git commit -m "Removed dev tests"
git push origin master

Within the root of the project, make sure you have a .gitignore with the following in

dev/tests/*
steadweb
  • 15,364
  • 3
  • 33
  • 47