Macbook external hard drive usage for Xcode projects

I have a M2 macbook pro Which has storage problem. I work with react native and xcode. So I was wondering If I can keep react native projects in external hard drive that could run in xcode and also work with git. ??

Macbook external hard drive usage for Xcode projects
 
 
Q