I have a project in Bitbucket and I want to give access to one of my intern. I want to ignore certain Java files and certain file inside debug folder.
I have tried using the way, adding this line in my gitignore file:
/app/src/main/java/com/example/amanv/emulatordetection/NewActivity.class
However, this didn't work out.
I also tried:
/NewActivity.class
didn't work out too.
How can I do that?
You can not ignore those files that you have previously committed, for that you have to remove those files from your git.
To do that first go to your file directory.
Now type this command to remove the file from your git.
git rm --cached [filename]
Now the file has been removed from your branch, and now you have to add the file name in your .gitignore file.
filename.java (Remember that the activity extension should be in java.)
After that, add the files to the branch and then commit them. Then finally, push and you will see the files are ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With