Git: is it possible to properly sync a fork master to upstream master using only shallow local clones?

I cannot find a way to sync my fork with upstream on a shallow local clone. I work in tmpfs (RAM) without swap as I wouldn’t like having several GB of my SSD dedicated just to storing .git of CDDA. If there is a way it should definitely be added to doc/DEVELOPER_FAQ.md . I tried pulling just 120 commits with git pull --depth=120 upstream master and .git exploded to 1 GB immediately. It’s an improvement over 2+ GB for full history but I still cannot push to origin (my fork master) because the clone is shallow. git version is 2.25.1 .