0

I hope to stop monitoring the file misc.xml, and don't commit the change of file to Github. How can I do? Thanks!

And more, all files under the folder .idea should be ignore when I use Git, right?

The Image

enter image description here

HelloCW
  • 843
  • 22
  • 125
  • 310

2 Answers2

1

First add the file/folder to your .gitignore file (project-level)

Go to the Terminal in Android Studio and type in these commands:

git rm -r the-directory-to-remove

The above command will remove the specified directory from git.

git commit -m "Delete .idea folder"

The above command commits the changes, you can change "Delete .idea folder" to whatever you like.

git push origin <your-git-branch>

The above command pushes the changes to Github (or BitBucket).

Now, if you want to delete the file from Github/BitBucket ONLY but not from the entire filesystem, run git rm -r --cached myFolder instead of the first command.

SnakeException
  • 1,148
  • 1
  • 8
  • 26
0

Add the path of file or folder in .gitignore file which located in project root directory. If not make a file with name .gitignore .

Here is the documentation

https://git-scm.com/docs/gitignore

Example of .gitignore file might be helpful