How to get rid of .pyc
Question:
I’ve been creating a Django app and I have a question about .pyc.
I don’t know exactly when, but I believe when I created a branch and moved into the branch, I always had a problem about .pyc. Three .pyc files always emerge to branch areas on VSCode.
I want to even delete the three files, but I don’t think it’s the best way to solve this. Or maybe I can’t delete them for another reason.
Answers:
You can put these files in .gitignore
. Add whatever you don’t want to push to git
*.egg
*.egg-info
*.bv
*.pyc
build
__pycache__
eggs
First add those three file names or provide extension like this *.xyz
inside your .gitignore
file and than run this command git rm --cached .
to remove cached files and than push it to your branch
‘.’ represent all files in current directory if you want to remove
chache of perticular file than add file names like this git rm --cached file1 file2
I’ve been creating a Django app and I have a question about .pyc.
I don’t know exactly when, but I believe when I created a branch and moved into the branch, I always had a problem about .pyc. Three .pyc files always emerge to branch areas on VSCode.
I want to even delete the three files, but I don’t think it’s the best way to solve this. Or maybe I can’t delete them for another reason.
You can put these files in .gitignore
. Add whatever you don’t want to push to git
*.egg
*.egg-info
*.bv
*.pyc
build
__pycache__
eggs
First add those three file names or provide extension like this *.xyz
inside your .gitignore
file and than run this command git rm --cached .
to remove cached files and than push it to your branch
‘.’ represent all files in current directory if you want to remove
chache of perticular file than add file names like thisgit rm --cached file1 file2