I see 2 options to this scenario
Option 1 - Hide your changes by using .gitignore
I would use this option if you don't have too many changes to make, but even then you may need to deal with the issue of not changing the repo's .gitignore
file, as discussed here:
How to ignore files only locally in git?
Option 2 - create a 2nd, local, "pristine" repo
If you are working on a non-trivial app, (involving a DB connections, passwords, debugging etc) and want to work freely without worrying about sending extraneous code to the upstream repo, you can create a 2nd local repo, whose only purpose will be to hold the commit snapshots you want to send to the main repo.
create 2nd "pristine" local repo
git clone https://github.com/user_name/project_name.git pristine/
Once you are ready to send work to the main upstream or origin, you can add the development/dirty repo as a remote to the pristine and fetch work from it.
git cherrypick
could be useful to help get things organised.
(From the pristine repo folder) add the "dirty" repo as a remote:
git remote add dirty file:///path/to/your/repo
fetch the work you want to push
git fetch dirty/<branch>
(Once you are happy with changes) push to main upstream
git push origin