Here are a collection of command line arguments, which will help you fix your issues with .pyc files.
Go to your project root, the folder which is the base of your git repo.
Make sure your project is up to date with your remote, run git fetch
Make sure you are on your main branch, run git checkout main
Make sure your local branch is up to date, run git pull
Update your git ignore, add these lines to the .gitignore
file in your project root.
(Don't include the ... those are to signify there may be existing content which you do not remove.)
...
# Python temp files
__pycache__/
*.py[cod]
*$py.class
...
Remove .pyc files using git rm -f *.pyc
Commit the changes git commit -am 'update to remove all pyc files'
Push your update git push
Update your other branches by following this process.
select your branch, run git checkout <branch name>
where branch name is the name of your branch
(do not include the < and > )
check your branch is up to date, run git pull
merge in your changes from main, run git merge main
remove your pyc files, run git rm -f *.pyc
commit the changes with git commit --no-edit
check your repo is happy with git status
if happy, push your changes git push
repeat this for each branch you need to fix.