how to ignore folder when using adb push
This sounds like an XY problem as excluding files and directories with adb push isn't what you're really intending to do.

If you're syncing Git repositories, the best option is a Git client. The one I'm currently using is Termux and I do a lot of development on my phone with it.

Download Termux and use its built-in APT package manager to install Git and you'll be able to process your work easily.